summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtColorSelectionStyledItemDelegate.h')
-rw-r--r--Swift/QtUI/QtColorSelectionStyledItemDelegate.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/Swift/QtUI/QtColorSelectionStyledItemDelegate.h b/Swift/QtUI/QtColorSelectionStyledItemDelegate.h
new file mode 100644
index 0000000..d6b3336
--- /dev/null
+++ b/Swift/QtUI/QtColorSelectionStyledItemDelegate.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <QStyledItemDelegate>
+
+namespace Swift {
+
+class QtColorSelectionStyledItemDelegate : public QStyledItemDelegate {
+ public:
+ QtColorSelectionStyledItemDelegate(QObject* parent = nullptr);
+
+ virtual void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex&) const;
+
+ public:
+ static const int DATA_ROLE = Qt::UserRole + 1;
+
+ protected:
+ virtual bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index);
+};
+
+}