From: Soeren Apel Date: Thu, 14 Mar 2019 18:47:02 +0000 (+0100) Subject: DecoderSelector: Make PD names italic X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=edf9f6bb11b13559afba60834be6e8d3578f03c0;p=pulseview.git DecoderSelector: Make PD names italic --- diff --git a/pv/subwindows/decoder_selector/model.cpp b/pv/subwindows/decoder_selector/model.cpp index 31dfd464..7b41a39f 100644 --- a/pv/subwindows/decoder_selector/model.cpp +++ b/pv/subwindows/decoder_selector/model.cpp @@ -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(index.internalPointer()); - DecoderCollectionItem* item = - static_cast(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