comparison src/mainwindow.cpp @ 32:179239c94740

(issue7-8) Add shortcuts for play/pause and next
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 06 May 2015 15:31:54 +0200
parents 64a51a42c01f
children 58f1b3c330af
comparison
equal deleted inserted replaced
31:749ecdfd036a 32:179239c94740
32 #include <QStandardPaths> 32 #include <QStandardPaths>
33 #include <QStyle> 33 #include <QStyle>
34 #include <QStatusBar> 34 #include <QStatusBar>
35 #include <QTabWidget> 35 #include <QTabWidget>
36 #include <QVBoxLayout> 36 #include <QVBoxLayout>
37 #include <QShortcut>
38 #include <QKeySequence>
37 39
38 MainWindow::MainWindow() : 40 MainWindow::MainWindow() :
39 mDataView(NULL) { 41 mDataView(NULL) {
40 setStatusBar(new QStatusBar()); 42 setStatusBar(new QStatusBar());
41 //resize(1190, 500); 43 //resize(1190, 500);
42 44
43 setupGUI(); 45 setupGUI();
44 readSettings(); 46 readSettings();
45 setAcceptDrops(true); 47 setAcceptDrops(true);
48 setupShortcuts();
46 //QIcon windowIcon = QIcon(":/icon-64.png"); 49 //QIcon windowIcon = QIcon(":/icon-64.png");
47 //setWindowIcon(windowIcon); 50 //setWindowIcon(windowIcon);
48 51
49 } 52 }
50 53
197 this, &MainWindow::setRootFolder); 200 this, &MainWindow::setRootFolder);
198 201
199 fsDialog->show(); 202 fsDialog->show();
200 // connect(fsDialog, &QDialog::closeEvent, fsDialog, &QObject::deleteLater); 203 // connect(fsDialog, &QDialog::closeEvent, fsDialog, &QObject::deleteLater);
201 } 204 }
205
206 void MainWindow::setupShortcuts() {
207 QShortcut *next = new QShortcut(Qt::Key_Right, this);
208 QShortcut *prev = new QShortcut(Qt::Key_Left, this);
209 QShortcut *pause = new QShortcut(Qt::Key_Space, this);
210
211 connect(pause, &QShortcut::activated, mPlayer, &PNGPlayer::togglePlay);
212 connect(next, &QShortcut::activated, mDataView, &MetaDataView::selectNextRow);
213 connect(prev, &QShortcut::activated, mDataView, &MetaDataView::selectPrevRow);
214 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)