OGS
ColorTableView.h
Go to the documentation of this file.
1
14#pragma once
15
16#include <QItemDelegate>
17#include <QTableView>
18
22class ColorTableView : public QTableView
23{
24 Q_OBJECT
25
26public:
28 explicit ColorTableView(QWidget* parent = nullptr);
29};
30
34class ColorTableViewDelegate : public QItemDelegate
35{
36 Q_OBJECT
37
38public:
40 explicit ColorTableViewDelegate(QWidget* parent = nullptr)
41 : QItemDelegate(parent)
42 {
43 }
45 void paint(QPainter* painter, const QStyleOptionViewItem& option,
46 const QModelIndex& index) const override;
47
48 QSize sizeHint(const QStyleOptionViewItem& option,
49 const QModelIndex& index) const override;
50};
ColorTableViewDelegate(QWidget *parent=nullptr)
Constructor.
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Overwrites the paint-method to set user-defined properties instead of the default properties.
ColorTableView(QWidget *parent=nullptr)
Constructor.