From 83d2b014f563b9de387c4d8e9e45adbb36b56825 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 28 Dec 2011 19:36:05 +0100 Subject: Mark items in DbAnalyzerDialog It's now possible to mark items in DbAnalyzerDialog with a different color, when there are no covers or actor information available on the net. I enhanced SmTreeItem to contain a QVariant::foregroundColor, and made SmTreeModel return it when QModelIndex::data with role Qt::ForegroundRole is called. Maybe that could be useful for other things like favorites and such... --- smtreemodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'smtreemodel.cpp') diff --git a/smtreemodel.cpp b/smtreemodel.cpp index 50a55d0..86d2b77 100644 --- a/smtreemodel.cpp +++ b/smtreemodel.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "smtreemodel.h" #include "smtreeitem.h" @@ -107,6 +108,10 @@ QVariant SmTreeModel::data(const QModelIndex &index, int role) const{ return mDecorationIcon; } } + if(role == Qt::ForegroundRole){ + QColor fgCol = item->foregroundColor().value(); + return QBrush(fgCol); + } return QVariant(); } -- cgit v1.2.3-70-g09d2