Two shortcuts Fit to best (Ctrl+=) and Original zoom (Ctrl+0).

--HG--
branch : develop
This commit is contained in:
dismine 2014-10-24 18:05:41 +03:00
parent 2bd82fa340
commit ea0e733602
2 changed files with 19 additions and 4 deletions

View File

@ -928,17 +928,27 @@ void MainWindow::ToolBarTools()
QKeySequence::ZoomOut). For examle "+" is Qt::Key_Plus + Qt::KeypadModifier for keypad.
Also for me don't work Qt:CTRL and work Qt::ControlModifier.*/
const QList<QKeySequence> zoomInShortcuts = QList<QKeySequence>() << QKeySequence::ZoomIn
<< Qt::ControlModifier + Qt::Key_Plus + Qt::KeypadModifier;
QList<QKeySequence> zoomInShortcuts;
zoomInShortcuts.append(QKeySequence(QKeySequence::ZoomIn));
zoomInShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Plus + Qt::KeypadModifier));
ui->actionZoomIn->setShortcuts(zoomInShortcuts);
connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomIn);
const QList<QKeySequence> zoomOutShortcuts = QList<QKeySequence>() << QKeySequence::ZoomOut
<< Qt::ControlModifier + Qt::Key_Minus + Qt::KeypadModifier;
QList<QKeySequence> zoomOutShortcuts;
zoomOutShortcuts.append(QKeySequence(QKeySequence::ZoomOut));
zoomOutShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Minus + Qt::KeypadModifier));
ui->actionZoomOut->setShortcuts(zoomOutShortcuts);
connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomOut);
QList<QKeySequence> zoomOriginalShortcuts;
zoomOriginalShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_0));
zoomOriginalShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_0 + Qt::KeypadModifier));
ui->actionZoomOriginal->setShortcuts(zoomOriginalShortcuts);
connect(ui->actionZoomOriginal, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomOriginal);
QList<QKeySequence> zoomFitBestShortcuts;
zoomFitBestShortcuts.append(QKeySequence(Qt::ControlModifier + Qt::Key_Equal));
ui->actionZoomFitBest->setShortcuts(zoomFitBestShortcuts);
connect(ui->actionZoomFitBest, &QAction::triggered, ui->view, &VMainGraphicsView::ZoomFitBest);
}

View File

@ -791,6 +791,8 @@
<addaction name="actionHistory"/>
<addaction name="actionZoomIn"/>
<addaction name="actionZoomOut"/>
<addaction name="actionZoomFitBest"/>
<addaction name="actionZoomOriginal"/>
<addaction name="separator"/>
<addaction name="actionPattern_properties"/>
<addaction name="actionEdit_pattern_code"/>
@ -1211,6 +1213,9 @@
<property name="text">
<string>Zoom fit best</string>
</property>
<property name="shortcut">
<string>Ctrl+=</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>