diff options
author | Eike Ziller <eike.ziller@qt.io> | 2023-01-12 16:12:40 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2023-01-16 10:43:46 +0000 |
commit | 514a62b9b26fcdc19d8bdad5d2db22306304c055 (patch) | |
tree | ba7c46fedfef41b88c735fca3130ec0d25b586ac /src/plugins/qtsupport/exampleslistmodel.cpp | |
parent | 2f70875ee3e5d1ef51216d5594d098baf968e3ec (diff) |
ExamplesListModel: Remove unneeded override of data(...)
It seems to have been a workaround for taking tags into account for the
filtering, but that is done completely different nowadays, and not with
the DisplayRole.
Change-Id: Iff73c1a33de4a40c4919794a8644fdc4af710ba1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/exampleslistmodel.cpp')
-rw-r--r-- | src/plugins/qtsupport/exampleslistmodel.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index 849b506eaf..21261b384e 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -637,29 +637,6 @@ QStringList ExampleSetModel::exampleSources(QString *examplesInstallPath, QStrin return sources; } -QString prefixForItem(const ExampleItem *item) -{ - QTC_ASSERT(item, return {}); - if (item->isHighlighted) - return QLatin1String("0000 "); - return QString(); -} - -QVariant ExamplesListModel::data(const QModelIndex &index, int role) const -{ - if (!index.isValid() || index.row() >= m_items.count()) - return QVariant(); - - ExampleItem *item = static_cast<ExampleItem *>(m_items.at(index.row())); - switch (role) - { - case Qt::DisplayRole: // for search only - return QString(prefixForItem(item) + item->name + ' ' + item->tags.join(' ')); - default: - return ListModel::data(index, role); - } -} - void ExampleSetModel::selectExampleSet(int index) { if (index != m_selectedExampleSetIndex) { |