diff options
| author | 2009-09-30 21:57:58 +0000 | |
|---|---|---|
| committer | 2009-09-30 21:57:58 +0000 | |
| commit | 2181ad315bcc70741091456d729c8d26fbb18fa8 (patch) | |
| tree | 73f9bc762eecde0c4de01a3f668b4115cf0c2aee /src/modules/objects/class_tablewidget.h | |
| parent | removed debug comment (diff) | |
| download | KVIrc-2181ad315bcc70741091456d729c8d26fbb18fa8.tar.gz KVIrc-2181ad315bcc70741091456d729c8d26fbb18fa8.tar.bz2 KVIrc-2181ad315bcc70741091456d729c8d26fbb18fa8.zip | |
Some fixes in objects module
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3535 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/objects/class_tablewidget.h')
| -rw-r--r-- | src/modules/objects/class_tablewidget.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/modules/objects/class_tablewidget.h b/src/modules/objects/class_tablewidget.h index 89ba41116..de81eeffc 100644 --- a/src/modules/objects/class_tablewidget.h +++ b/src/modules/objects/class_tablewidget.h @@ -31,6 +31,25 @@ #include "object_macros.h" #include <QtSql> #include <QTableWidgetItem> + +#include <QItemDelegate> +#include <QAbstractItemView> +#include "kvi_kvs_runtimecontext.h" +class KviKvsObject_tablewidget; + +class KviCellItemDelegate : public QItemDelegate +{ +public: + KviCellItemDelegate(QAbstractItemView * pWidget = 0,KviKvsObject_tablewidget *pParent=0); + ~KviCellItemDelegate(); +protected: +// QAbstractItemView * m_pParent; + KviKvsObject_tablewidget *m_pParentScript; +public: + QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; + void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const; +}; + class KviKvsObject_tablewidget : public KviKvsObject_widget { Q_OBJECT @@ -38,15 +57,20 @@ public: KVSO_DECLARE_OBJECT(KviKvsObject_tablewidget) public: QWidget * widget() { return (QWidget *)object(); }; -protected: + bool paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index); + + protected: QSqlQueryModel *model; -protected: + KviKvsRunTimeContext *m_pContext; + KviCellItemDelegate *m_pCellItemDelegate; + protected: virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); bool setText(KviKvsObjectFunctionCall *c); bool setToolTip(KviKvsObjectFunctionCall *c); bool text(KviKvsObjectFunctionCall *c); bool setIcon(KviKvsObjectFunctionCall *c); + bool setItemFlags(KviKvsObjectFunctionCall *c); bool setColumnCount(KviKvsObjectFunctionCall *c); bool columnCount(KviKvsObjectFunctionCall *c); @@ -78,4 +102,5 @@ protected slots: //void slotClicked(); }; + #endif // !_CLASS_TABLEWIDGET_H_ |
