From 2aba84b72e3ff110209da3ba1bdca07d3d21522c Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sat, 21 Dec 2013 14:01:41 +0900 Subject: assign a shortcut key to the Quit action in qdbusviewer Change-Id: I5c1f99741ba203c0fc405d49df51357ebf52e199 Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint --- src/qdbus/qdbusviewer/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qdbus/qdbusviewer/main.cpp b/src/qdbus/qdbusviewer/main.cpp index 5499192c..f539230b 100644 --- a/src/qdbus/qdbusviewer/main.cpp +++ b/src/qdbus/qdbusviewer/main.cpp @@ -82,7 +82,8 @@ int main(int argc, char *argv[]) QMenu *fileMenu = mw.menuBar()->addMenu(QObject::tr("&File")); QAction *quitAction = fileMenu->addAction(QObject::tr("&Quit"), &mw, SLOT(close())); - Q_UNUSED(quitAction); + quitAction->setShortcut(QKeySequence::Quit); + quitAction->setMenuRole(QAction::QuitRole); QMenu *helpMenu = mw.menuBar()->addMenu(QObject::tr("&Help")); QAction *aboutAction = helpMenu->addAction(QObject::tr("&About")); -- cgit v1.2.3