From d2899ad580eea569f3b167e8c9ebcb913194c6b6 Mon Sep 17 00:00:00 2001 From: ulflulfl Date: Sat, 1 Feb 2014 18:04:47 +0000 Subject: [PATCH] Fix bug #235. Add shortcut keys for View/Zoom In (Ctrl++) and View/Zoom Out (Ctrl+-) These are the shortcut keys for zoom in and out as suggested by QT. Works with the normal keyboard and numpad keys. Seems that the preferred simple + and - keys have an issue. While the - key is working and displayed in the menu as expected, the + key is zooming but not displayed at View/Zoom In in the menu. I've tried several attempts. --- pv/mainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 4de010a..e0ef3aa 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -159,6 +159,8 @@ void MainWindow::setup_ui() "MainWindow", "Zoom &In", 0, QApplication::UnicodeUTF8)); action_view_zoom_in->setIcon(QIcon::fromTheme("zoom-in", QIcon(":/icons/zoom-in.png"))); + // simply using Qt::Key_Plus shows no + in the menu + action_view_zoom_in->setShortcut(QKeySequence::ZoomIn); action_view_zoom_in->setObjectName( QString::fromUtf8("actionViewZoomIn")); menu_view->addAction(action_view_zoom_in); @@ -168,6 +170,7 @@ void MainWindow::setup_ui() "MainWindow", "Zoom &Out", 0, QApplication::UnicodeUTF8)); action_view_zoom_out->setIcon(QIcon::fromTheme("zoom-out", QIcon(":/icons/zoom-out.png"))); + action_view_zoom_out->setShortcut(QKeySequence::ZoomOut); action_view_zoom_out->setObjectName( QString::fromUtf8("actionViewZoomOut")); menu_view->addAction(action_view_zoom_out); -- 2.30.2