summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtabletevent
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-03-13 14:05:50 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-03-14 09:11:59 +0000
commit35c8a21fe49a06dca6287be82ec4608d35ea794c (patch)
tree280b84c706afe378de7b1a8eec7e32be46aa18ad /tests/manual/qtabletevent
parent68009a7d4334b7923dd777af086c234bec7acf98 (diff)
QTabletEvent manual test: add quit shortcut
Change-Id: I73012ec2d02856e5bbbc27d269f89b3918dd7c2d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'tests/manual/qtabletevent')
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.cpp3
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
index 3a0b1e0f21..14d059abc1 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp
@@ -33,7 +33,7 @@
#include <QMetaObject>
#include <QMetaEnum>
-TabletWidget::TabletWidget(bool mouseToo) : mMouseToo(mouseToo), mWheelEventCount(0)
+TabletWidget::TabletWidget(bool mouseToo) : mMouseToo(mouseToo), mWheelEventCount(0), mQuitShortcut(QKeySequence::Quit, this)
{
QPalette newPalette = palette();
newPalette.setColor(QPalette::Window, Qt::white);
@@ -41,6 +41,7 @@ TabletWidget::TabletWidget(bool mouseToo) : mMouseToo(mouseToo), mWheelEventCoun
setPalette(newPalette);
qApp->installEventFilter(this);
resetAttributes();
+ connect(&mQuitShortcut, SIGNAL(activated()), qApp, SLOT(quit()));
}
bool TabletWidget::eventFilter(QObject *, QEvent *ev)
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.h b/tests/manual/qtabletevent/device_information/tabletwidget.h
index 0d27c2eea0..404be1289f 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.h
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.h
@@ -31,6 +31,7 @@
#include <QWidget>
#include <QTabletEvent>
+#include <QShortcut>
// a widget showing the information of the last tablet event
class TabletWidget : public QWidget
@@ -64,6 +65,7 @@ private:
bool mMouseToo;
ulong mTimestamp;
int mWheelEventCount;
+ QShortcut mQuitShortcut;
};
#endif // TABLETWIDGET_H