aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_tablewidget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/class_tablewidget.h')
-rw-r--r--src/modules/objects/class_tablewidget.h29
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_