diff options
author | Arno <arno@disconnect.de> | 2018-02-02 18:13:27 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-02-02 18:13:27 +0100 |
commit | 2f1e930668c1a2205a09ee835908d28b2bdedcdd (patch) | |
tree | 7f9331fd80e45e27994a0a5ebc2e61e4dc69be23 /searchdialog.cpp | |
parent | 3a4b40917ba45e3dd34e14816d12ca8a6bd510f7 (diff) | |
download | ShemovCleaner-2f1e930668c1a2205a09ee835908d28b2bdedcdd.tar.gz ShemovCleaner-2f1e930668c1a2205a09ee835908d28b2bdedcdd.tar.bz2 ShemovCleaner-2f1e930668c1a2205a09ee835908d28b2bdedcdd.zip |
Implement context menu for search results
Subclass QTreeView to show a custom context menu. Since the depth of
some items is > 1, add an option to expand and collapse a node
recursively.
Diffstat (limited to 'searchdialog.cpp')
-rw-r--r-- | searchdialog.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searchdialog.cpp b/searchdialog.cpp index 1f59839..8c255c8 100644 --- a/searchdialog.cpp +++ b/searchdialog.cpp @@ -15,6 +15,7 @@ #include <QApplication> #include "searchdialog.h" +#include "searchview.h" #include "helper.h" SearchDialog::SearchDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){ @@ -39,7 +40,7 @@ SearchDialog::SearchDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, mResM = new QStandardItemModel; QSortFilterProxyModel *resMProxy = new QSortFilterProxyModel; resMProxy->setSourceModel(mResM); - mResV = new QTreeView; + mResV = new SearchView; mResV->setModel(resMProxy); connect(mResV->selectionModel(), &QItemSelectionModel::currentChanged, this, &SearchDialog::doResult); QHBoxLayout *resGBL = new QHBoxLayout; @@ -49,7 +50,7 @@ SearchDialog::SearchDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, mDataM = new QStandardItemModel; QSortFilterProxyModel *dataMProxy = new QSortFilterProxyModel; dataMProxy->setSourceModel(mDataM); - mDataV = new QTreeView; + mDataV = new SearchView; mDataV->setModel(dataMProxy); QHBoxLayout *dataGBL = new QHBoxLayout; dataGBL->addWidget(mDataV); |