KVIrc 5.2.4
Developer APIs
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
32
33#include <QTableWidgetItem>
34#include <QItemDelegate>
35#include <QAbstractItemView>
36
38
39class KviCellItemDelegate : public QItemDelegate
40{
41public:
42 KviCellItemDelegate(QAbstractItemView * pWidget = nullptr, KvsObject_tableWidget * pParent = nullptr);
44
45protected:
47
48public:
49 QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override;
50 void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const override;
51};
52
54{
55 Q_OBJECT
56public:
58public:
59 QWidget * widget() { return (QWidget *)object(); };
60 bool paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index);
61
62protected:
65
66protected:
67 bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams) override;
68
76
83
85
90
94
103
110protected 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_tableWidget.h:40
KvsObject_tableWidget * m_pParentScript
Definition KvsObject_tableWidget.h:46
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition KvsObject_tableWidget.cpp:883
void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Definition KvsObject_tableWidget.cpp:877
Definition KviKvsObjectFunctionCall.h:34
QObject * object() const
Definition KviKvsObject.h:94
Definition KviKvsRunTimeContext.h:104
Class to handle variant variables lists.
Definition KviKvsVariantList.h:42
Definition KvsObject_tableWidget.h:54
void cellActivated(int iRow, int iCol)
Definition KvsObject_tableWidget.cpp:821
bool setNumber(KviKvsObjectFunctionCall *c)
bool cellDoubleClickedEvent(KviKvsObjectFunctionCall *c)
bool setHorizontalHeaderLabels(KviKvsObjectFunctionCall *c)
bool setItemFlags(KviKvsObjectFunctionCall *c)
bool hideRow(KviKvsObjectFunctionCall *c)
bool text(KviKvsObjectFunctionCall *c)
bool setColumnCount(KviKvsObjectFunctionCall *c)
bool showHorizontalHeader(KviKvsObjectFunctionCall *c)
bool setRowCount(KviKvsObjectFunctionCall *c)
void slotItemEntered(QTableWidgetItem *)
Definition KvsObject_tableWidget.cpp:809
bool itemEnteredEvent(KviKvsObjectFunctionCall *c)
bool currentRow(KviKvsObjectFunctionCall *c)
bool setText(KviKvsObjectFunctionCall *c)
bool insertRow(KviKvsObjectFunctionCall *c)
QWidget * widget()
Definition KvsObject_tableWidget.h:59
bool hideColumn(KviKvsObjectFunctionCall *c)
bool showVerticalHeader(KviKvsObjectFunctionCall *c)
bool removeColumn(KviKvsObjectFunctionCall *c)
bool setForeground(KviKvsObjectFunctionCall *c)
bool setToolTip(KviKvsObjectFunctionCall *c)
bool currentColumn(KviKvsObjectFunctionCall *c)
bool itemRowColAt(KviKvsObjectFunctionCall *c)
bool clear(KviKvsObjectFunctionCall *c)
KviKvsRunTimeContext * m_pContext
Definition KvsObject_tableWidget.h:63
bool columnCount(KviKvsObjectFunctionCall *c)
KviCellItemDelegate * m_pCellItemDelegate
Definition KvsObject_tableWidget.h:64
bool cellActivatedEvent(KviKvsObjectFunctionCall *c)
bool hideVerticalHeader(KviKvsObjectFunctionCall *c)
bool resizeRowsToContents(KviKvsObjectFunctionCall *c)
bool hideHorizontalHeader(KviKvsObjectFunctionCall *c)
void cellDoubleClicked(int iRow, int iCol)
Definition KvsObject_tableWidget.cpp:833
bool removeRow(KviKvsObjectFunctionCall *c)
bool setIcon(KviKvsObjectFunctionCall *c)
bool setCellWidget(KviKvsObjectFunctionCall *c)
bool insertColumn(KviKvsObjectFunctionCall *c)
bool paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition KvsObject_tableWidget.cpp:844
bool showRow(KviKvsObjectFunctionCall *c)
bool showColumn(KviKvsObjectFunctionCall *c)
bool rowCount(KviKvsObjectFunctionCall *c)
bool setVerticalHeaderLabels(KviKvsObjectFunctionCall *c)
bool resizeColumnsToContents(KviKvsObjectFunctionCall *c)
Definition KvsObject_widget.h:40
#define KVSO_DECLARE_OBJECT(__className)
Definition object_macros.h:33
int init()
Definition winamp.cpp:118