diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-09-27 15:20:02 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-09-27 15:20:02 -0400 |
| commit | 51d664d76ce6b611e7a7585b209bad9d68fe65d7 (patch) | |
| tree | bfb235aab1f5c7b5cd6a8622739a166ad5f1c4fa /src/icondelegate.cpp | |
| parent | 5d74bd3789515a3e04e54267f1cdfe8f5397f6df (diff) | |
moved color stuff to ColorTable, now shows sample text and icons
Diffstat (limited to 'src/icondelegate.cpp')
| -rw-r--r-- | src/icondelegate.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/icondelegate.cpp b/src/icondelegate.cpp index 39038f3c..03964263 100644 --- a/src/icondelegate.cpp +++ b/src/icondelegate.cpp @@ -32,13 +32,10 @@ IconDelegate::IconDelegate(QObject *parent) {
}
-
-void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+void IconDelegate::paintIcons(
+ QPainter *painter, const QStyleOptionViewItem &option,
+ const QModelIndex &index, const QList<QString>& icons)
{
- QStyledItemDelegate::paint(painter, option, index);
-
- QList<QString> icons = getIcons(index);
-
int x = 4;
painter->save();
@@ -67,3 +64,9 @@ void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->restore();
}
+void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ QStyledItemDelegate::paint(painter, option, index);
+ paintIcons(painter, option, index, getIcons(index));
+}
+
|
