From 7c6deee2325d83f711fd28767467865da7cda848 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 11 Nov 2016 10:44:09 +0100 Subject: Play movie on doublelClick in RandomTab --- randomtab.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'randomtab.cpp') diff --git a/randomtab.cpp b/randomtab.cpp index 7b0dd59..291dcd7 100644 --- a/randomtab.cpp +++ b/randomtab.cpp @@ -132,6 +132,7 @@ void RandomTab::setupGui(){ mFileView->setRootIsDecorated(false); mFileView->setSelectionMode(QAbstractItemView::ExtendedSelection); mFileView->setSelectionBehavior(QAbstractItemView::SelectRows); + connect(mFileView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(playDoubleclicked(QModelIndex))); mFileModel = new QStandardItemModel; mFileProxy = new QSortFilterProxyModel; mFileProxy->setSourceModel(mFileModel); @@ -452,6 +453,14 @@ void RandomTab::playSelected(){ play(files); } +void RandomTab::playDoubleclicked(QModelIndex idx){ + QString fp = idx.sibling(0, FullPath).data().toString(); + logMessage(QString(tr("Doubleclick on %1")).arg(fp)); + QStringList f = QStringList() << fp; + play(f); + +} + void RandomTab::play(const QStringList &files){ QPair pgdata = Helper::programData("movieviewer"); QString program = pgdata.first; -- cgit v1.2.3-70-g09d2