]> sigrok.org Git - pulseview.git/commitdiff
DecoderSelector: Make PD names italic
authorSoeren Apel <redacted>
Thu, 14 Mar 2019 18:47:02 +0000 (19:47 +0100)
committerSoeren Apel <redacted>
Thu, 14 Mar 2019 18:47:02 +0000 (19:47 +0100)
pv/subwindows/decoder_selector/model.cpp

index 31dfd464bf6d07044e5a417f92baeab6dbce960a..7b41a39fb129dcdebb5d29f7bc99ed230995b082 100644 (file)
@@ -107,13 +107,22 @@ QVariant DecoderCollectionModel::data(const QModelIndex& index, int role) const
        if (!index.isValid())
                return QVariant();
 
-       if (role != Qt::DisplayRole)
-               return QVariant();
+       if (role == Qt::DisplayRole)
+       {
+               DecoderCollectionItem* item =
+                       static_cast<DecoderCollectionItem*>(index.internalPointer());
 
-       DecoderCollectionItem* item =
-               static_cast<DecoderCollectionItem*>(index.internalPointer());
+               return item->data(index.column());
+       }
 
-       return item->data(index.column());
+       if ((role == Qt::FontRole) && (index.parent().isValid()) && (index.column() == 0))
+       {
+               QFont font;
+               font.setItalic(true);
+               return QVariant(font);
+       }
+
+       return QVariant();
 }
 
 Qt::ItemFlags DecoderCollectionModel::flags(const QModelIndex& index) const