diff options
-rw-r--r-- | searchdialog.cpp | 16 | ||||
-rw-r--r-- | searchdialog.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/searchdialog.cpp b/searchdialog.cpp index 79a9c37..52bdc1b 100644 --- a/searchdialog.cpp +++ b/searchdialog.cpp @@ -24,6 +24,7 @@ #include <QStandardItemModel> #include <QSplitter> +#include "moviepropertiesdialog.h" #include "smtreeview.h" #include "smtreeitem.h" #include "smtreemodel.h" @@ -160,6 +161,8 @@ ActorsAndMore::ActorsAndMore(QWidget *parent, Qt::WindowFlags flags) : QWidget(p QSortFilterProxyModel *dataProxy = new QSortFilterProxyModel; dataProxy->setSourceModel(mDataModel); mDataView = new QTreeView; + mDataView->setExpandsOnDoubleClick(false); + connect(mDataView, &QTreeView::doubleClicked, this, &ActorsAndMore::dataDoubleClicked); mDataView->setModel(dataProxy); QHBoxLayout *resultHBL = new QHBoxLayout; resultHBL->addWidget(mResultView); @@ -237,6 +240,19 @@ void ActorsAndMore::doData(const QModelIndex &cur, const QModelIndex &prev){ } } +void ActorsAndMore::dataDoubleClicked(const QModelIndex &index){ + QModelIndex cur = index; + while(cur.parent().isValid()){ + cur = cur.parent(); + } + int searchType = mTypeSel->currentData().toInt(); + if(searchType == Actor){ + MoviePropertiesDialog propDlg(this); + propDlg.init(cur.data(IdRole).toInt()); + propDlg.exec(); + } +} + void ActorsAndMore::getDataForActor(QModelIndex cur){ mDataModel->clear(); mDataModel->setColumnCount(1); diff --git a/searchdialog.h b/searchdialog.h index ca7d859..ca16b79 100644 --- a/searchdialog.h +++ b/searchdialog.h @@ -52,6 +52,7 @@ class ActorsAndMore : public QWidget { public slots: void doSearch(); void doData(const QModelIndex &cur, const QModelIndex &prev); + void dataDoubleClicked(const QModelIndex &index); private: void searchActor(const QString &actor); |