KVIrc  4.9.2
DeveloperAPIs
KvsObject_tableWidget.h
Go to the documentation of this file.
1 #ifndef _CLASS_TABLEWIDGET_H_
2 #define _CLASS_TABLEWIDGET_H_
3 //=============================================================================
4 //
5 // File : KvsObject_tableWidget.h
6 // Creation date : Wed 4 Feb 2009 09:30:05 CEST by Carbone Alessandro
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2000 Krzysztof Godlewski
10 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "KvsObject_widget.h"
29 #include "object_macros.h"
30 
31 #include "KviKvsRunTimeContext.h"
32 
33 #include <QTableWidgetItem>
34 #include <QItemDelegate>
35 #include <QAbstractItemView>
36 
38 
39 class KviCellItemDelegate : public QItemDelegate
40 {
41 public:
42  KviCellItemDelegate(QAbstractItemView * pWidget = 0, KvsObject_tableWidget * pParent = 0);
44 
45 protected:
47 
48 public:
49  QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const;
50  void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const;
51 };
52 
54 {
55  Q_OBJECT
56 public:
58 public:
59  QWidget * widget() { return (QWidget *)object(); };
60  bool paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index);
61 
62 protected:
65 
66 protected:
67  virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams);
68 
76 
83 
85 
90 
94 
103 
110 protected slots:
111  void slotItemEntered(QTableWidgetItem *);
112  void cellActivated(int iRow, int iCol);
113  void cellDoubleClicked(int iRow, int iCol);
114 };
115 
116 #endif // !_CLASS_TABLEWIDGET_H_
Definition: KvsObject_widget.h:39
Definition: KvsObject_tableWidget.h:39
bool setText(KviKvsObjectFunctionCall *c)
bool hideColumn(KviKvsObjectFunctionCall *c)
bool insertColumn(KviKvsObjectFunctionCall *c)
char s char s char s s s s s char char c s *s c s s s d c s *s d c d d d d c
Definition: KviIrcNumericCodes.h:391
bool setToolTip(KviKvsObjectFunctionCall *c)
bool showColumn(KviKvsObjectFunctionCall *c)
bool text(KviKvsObjectFunctionCall *c)
QWidget * widget()
Definition: KvsObject_tableWidget.h:59
Class to handle variant variables lists.
Definition: KviKvsVariantList.h:41
bool setRowCount(KviKvsObjectFunctionCall *c)
void cellDoubleClicked(int iRow, int iCol)
Definition: KvsObject_tableWidget.cpp:829
Definition: KviKvsObjectFunctionCall.h:33
bool hideHorizontalHeader(KviKvsObjectFunctionCall *c)
bool removeRow(KviKvsObjectFunctionCall *c)
bool showHorizontalHeader(KviKvsObjectFunctionCall *c)
virtual bool init(KviKvsRunTimeContext *pContext, KviKvsVariantList *pParams)
Definition: KvsObject_tableWidget.cpp:246
void slotItemEntered(QTableWidgetItem *)
Definition: KvsObject_tableWidget.cpp:805
void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: KvsObject_tableWidget.cpp:873
bool hideRow(KviKvsObjectFunctionCall *c)
bool resizeRowsToContents(KviKvsObjectFunctionCall *c)
bool removeColumn(KviKvsObjectFunctionCall *c)
bool showRow(KviKvsObjectFunctionCall *c)
void cellActivated(int iRow, int iCol)
Definition: KvsObject_tableWidget.cpp:817
bool resizeColumnsToContents(KviKvsObjectFunctionCall *c)
bool setVerticalHeaderLabels(KviKvsObjectFunctionCall *c)
bool hideVerticalHeader(KviKvsObjectFunctionCall *c)
bool currentColumn(KviKvsObjectFunctionCall *c)
bool cellActivatedEvent(KviKvsObjectFunctionCall *c)
bool setCellWidget(KviKvsObjectFunctionCall *c)
bool cellDoubleClickedEvent(KviKvsObjectFunctionCall *c)
#define KVSO_DECLARE_OBJECT(__className)
Definition: object_macros.h:33
bool rowCount(KviKvsObjectFunctionCall *c)
bool showVerticalHeader(KviKvsObjectFunctionCall *c)
bool insertRow(KviKvsObjectFunctionCall *c)
KviCellItemDelegate(QAbstractItemView *pWidget=0, KvsObject_tableWidget *pParent=0)
Definition: KvsObject_tableWidget.cpp:865
KviCellItemDelegate * m_pCellItemDelegate
Definition: KvsObject_tableWidget.h:64
bool currentRow(KviKvsObjectFunctionCall *c)
bool setHorizontalHeaderLabels(KviKvsObjectFunctionCall *c)
bool setIcon(KviKvsObjectFunctionCall *c)
QObject * object() const
Definition: KviKvsObject.h:94
bool setItemFlags(KviKvsObjectFunctionCall *c)
bool itemRowColAt(KviKvsObjectFunctionCall *c)
Definition: KviKvsRunTimeContext.h:103
bool paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: KvsObject_tableWidget.cpp:840
Definition: KvsObject_tableWidget.h:53
KvsObject_tableWidget * m_pParentScript
Definition: KvsObject_tableWidget.h:46
bool setColumnCount(KviKvsObjectFunctionCall *c)
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: KvsObject_tableWidget.cpp:879
bool columnCount(KviKvsObjectFunctionCall *c)
bool setNumber(KviKvsObjectFunctionCall *c)
KviKvsRunTimeContext * m_pContext
Definition: KvsObject_tableWidget.h:63
bool itemEnteredEvent(KviKvsObjectFunctionCall *c)
bool clear(KviKvsObjectFunctionCall *c)
bool setForeground(KviKvsObjectFunctionCall *c)