diff options
Diffstat (limited to 'randomtab.cpp')
-rw-r--r-- | randomtab.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<QString, QStringList> pgdata = Helper::programData("movieviewer"); QString program = pgdata.first; |