[Qt6] Fix shortcut key sequences
This commit is contained in:
@@ -462,17 +462,17 @@ void MainWindow::createActions()
|
|||||||
#endif // !QT_NO_CLIPBOARD
|
#endif // !QT_NO_CLIPBOARD
|
||||||
|
|
||||||
QAction *insertBlankRowAct = editMenu->addAction(tr("Insert blank row"));
|
QAction *insertBlankRowAct = editMenu->addAction(tr("Insert blank row"));
|
||||||
insertBlankRowAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_I));
|
insertBlankRowAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_I));
|
||||||
insertBlankRowAct->setStatusTip(tr("Insert a blank row at the cursor position"));
|
insertBlankRowAct->setStatusTip(tr("Insert a blank row at the cursor position"));
|
||||||
connect(insertBlankRowAct, &QAction::triggered, [=]() { insertRow(false); } );
|
connect(insertBlankRowAct, &QAction::triggered, [=]() { insertRow(false); } );
|
||||||
|
|
||||||
QAction *insertCopyRowAct = editMenu->addAction(tr("Insert copy row"));
|
QAction *insertCopyRowAct = editMenu->addAction(tr("Insert copy row"));
|
||||||
insertCopyRowAct->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I));
|
insertCopyRowAct->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_I));
|
||||||
insertCopyRowAct->setStatusTip(tr("Insert a row that's a copy of the row at the cursor position"));
|
insertCopyRowAct->setStatusTip(tr("Insert a row that's a copy of the row at the cursor position"));
|
||||||
connect(insertCopyRowAct, &QAction::triggered, [=]() { insertRow(true); } );
|
connect(insertCopyRowAct, &QAction::triggered, [=]() { insertRow(true); } );
|
||||||
|
|
||||||
QAction *deleteRowAct = editMenu->addAction(tr("Delete row"));
|
QAction *deleteRowAct = editMenu->addAction(tr("Delete row"));
|
||||||
deleteRowAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_D));
|
deleteRowAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_D));
|
||||||
deleteRowAct->setStatusTip(tr("Delete the row at the cursor position"));
|
deleteRowAct->setStatusTip(tr("Delete the row at the cursor position"));
|
||||||
connect(deleteRowAct, &QAction::triggered, this, &MainWindow::deleteRow);
|
connect(deleteRowAct, &QAction::triggered, this, &MainWindow::deleteRow);
|
||||||
|
|
||||||
@@ -498,26 +498,26 @@ void MainWindow::createActions()
|
|||||||
|
|
||||||
QAction *revealAct = viewMenu->addAction(tr("&Reveal"));
|
QAction *revealAct = viewMenu->addAction(tr("&Reveal"));
|
||||||
revealAct->setCheckable(true);
|
revealAct->setCheckable(true);
|
||||||
revealAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_R));
|
revealAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_R));
|
||||||
revealAct->setStatusTip(tr("Toggle reveal"));
|
revealAct->setStatusTip(tr("Toggle reveal"));
|
||||||
connect(revealAct, &QAction::toggled, m_textWidget, &TeletextWidget::setReveal);
|
connect(revealAct, &QAction::toggled, m_textWidget, &TeletextWidget::setReveal);
|
||||||
|
|
||||||
QAction *mixAct = viewMenu->addAction(tr("&Mix"));
|
QAction *mixAct = viewMenu->addAction(tr("&Mix"));
|
||||||
mixAct->setCheckable(true);
|
mixAct->setCheckable(true);
|
||||||
mixAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_M));
|
mixAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_M));
|
||||||
mixAct->setStatusTip(tr("Toggle mix"));
|
mixAct->setStatusTip(tr("Toggle mix"));
|
||||||
connect(mixAct, &QAction::toggled, m_textWidget, &TeletextWidget::setMix);
|
connect(mixAct, &QAction::toggled, m_textWidget, &TeletextWidget::setMix);
|
||||||
connect(mixAct, &QAction::toggled, m_textScene, &LevelOneScene::setMix);
|
connect(mixAct, &QAction::toggled, m_textScene, &LevelOneScene::setMix);
|
||||||
|
|
||||||
QAction *gridAct = viewMenu->addAction(tr("&Grid"));
|
QAction *gridAct = viewMenu->addAction(tr("&Grid"));
|
||||||
gridAct->setCheckable(true);
|
gridAct->setCheckable(true);
|
||||||
gridAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_G));
|
gridAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_G));
|
||||||
gridAct->setStatusTip(tr("Toggle the text grid"));
|
gridAct->setStatusTip(tr("Toggle the text grid"));
|
||||||
connect(gridAct, &QAction::toggled, m_textScene, &LevelOneScene::toggleGrid);
|
connect(gridAct, &QAction::toggled, m_textScene, &LevelOneScene::toggleGrid);
|
||||||
|
|
||||||
QAction *showControlCodesAct = viewMenu->addAction(tr("Show control codes"));
|
QAction *showControlCodesAct = viewMenu->addAction(tr("Show control codes"));
|
||||||
showControlCodesAct->setCheckable(true);
|
showControlCodesAct->setCheckable(true);
|
||||||
showControlCodesAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_T));
|
showControlCodesAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_T));
|
||||||
showControlCodesAct->setStatusTip(tr("Toggle showing of control codes"));
|
showControlCodesAct->setStatusTip(tr("Toggle showing of control codes"));
|
||||||
connect(showControlCodesAct, &QAction::toggled, m_textWidget, &TeletextWidget::setShowControlCodes);
|
connect(showControlCodesAct, &QAction::toggled, m_textWidget, &TeletextWidget::setShowControlCodes);
|
||||||
|
|
||||||
@@ -572,7 +572,7 @@ void MainWindow::createActions()
|
|||||||
connect(zoomOutAct, &QAction::triggered, this, &MainWindow::zoomOut);
|
connect(zoomOutAct, &QAction::triggered, this, &MainWindow::zoomOut);
|
||||||
|
|
||||||
QAction *zoomResetAct = viewMenu->addAction(tr("Reset zoom"));
|
QAction *zoomResetAct = viewMenu->addAction(tr("Reset zoom"));
|
||||||
zoomResetAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0));
|
zoomResetAct->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
|
||||||
zoomResetAct->setStatusTip(tr("Reset zoom level"));
|
zoomResetAct->setStatusTip(tr("Reset zoom level"));
|
||||||
connect(zoomResetAct, &QAction::triggered, this, &MainWindow::zoomReset);
|
connect(zoomResetAct, &QAction::triggered, this, &MainWindow::zoomReset);
|
||||||
|
|
||||||
@@ -584,19 +584,19 @@ void MainWindow::createActions()
|
|||||||
const char *colours[] = { "Black", "Red", "Green", "Yellow", "Blue", "Magenta", "Cyan", "White" };
|
const char *colours[] = { "Black", "Red", "Green", "Yellow", "Blue", "Magenta", "Cyan", "White" };
|
||||||
|
|
||||||
QAction *alphaColour = alphaColourSubMenu->addAction(tr(colours[i]));
|
QAction *alphaColour = alphaColourSubMenu->addAction(tr(colours[i]));
|
||||||
alphaColour->setShortcut(QKeySequence(Qt::Key_Escape, Qt::Key_0 + i));
|
alphaColour->setShortcut(QKeySequence(QString("Esc, %1").arg(i)));
|
||||||
alphaColour->setStatusTip(QString("Insert alphanumeric %1 attribute").arg(QString(colours[i]).toLower()));
|
alphaColour->setStatusTip(QString("Insert alphanumeric %1 attribute").arg(QString(colours[i]).toLower()));
|
||||||
connect(alphaColour, &QAction::triggered, [=]() { m_textWidget->setCharacter(i); });
|
connect(alphaColour, &QAction::triggered, [=]() { m_textWidget->setCharacter(i); });
|
||||||
|
|
||||||
QAction *mosaicColour = mosaicColourSubMenu->addAction(tr(colours[i]));
|
QAction *mosaicColour = mosaicColourSubMenu->addAction(tr(colours[i]));
|
||||||
mosaicColour->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_0 + i));
|
mosaicColour->setShortcut(QKeySequence(QString("Esc, Shift+%1").arg(i)));
|
||||||
mosaicColour->setStatusTip(QString("Insert mosaic %1 attribute").arg(QString(colours[i]).toLower()));
|
mosaicColour->setStatusTip(QString("Insert mosaic %1 attribute").arg(QString(colours[i]).toLower()));
|
||||||
connect(mosaicColour, &QAction::triggered, [=]() { m_textWidget->setCharacter(i+0x10); });
|
connect(mosaicColour, &QAction::triggered, [=]() { m_textWidget->setCharacter(i+0x10); });
|
||||||
}
|
}
|
||||||
|
|
||||||
QMenu *mosaicsStyleSubMenu = insertMenu->addMenu(tr("Mosaics style"));
|
QMenu *mosaicsStyleSubMenu = insertMenu->addMenu(tr("Mosaics style"));
|
||||||
QAction *mosaicsSeparatedAct = mosaicsStyleSubMenu->addAction(tr("Separated mosaics"));
|
QAction *mosaicsSeparatedAct = mosaicsStyleSubMenu->addAction(tr("Separated mosaics"));
|
||||||
mosaicsSeparatedAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_S));
|
mosaicsSeparatedAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::SHIFT | Qt::Key_S));
|
||||||
mosaicsSeparatedAct->setStatusTip(tr("Insert separated mosaics attribute"));
|
mosaicsSeparatedAct->setStatusTip(tr("Insert separated mosaics attribute"));
|
||||||
connect(mosaicsSeparatedAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1a); });
|
connect(mosaicsSeparatedAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1a); });
|
||||||
QAction *mosaicsContiguousAct = mosaicsStyleSubMenu->addAction(tr("Contiguous mosaics"));
|
QAction *mosaicsContiguousAct = mosaicsStyleSubMenu->addAction(tr("Contiguous mosaics"));
|
||||||
@@ -606,7 +606,7 @@ void MainWindow::createActions()
|
|||||||
|
|
||||||
QMenu *mosaicsHoldSubMenu = insertMenu->addMenu(tr("Mosaics hold"));
|
QMenu *mosaicsHoldSubMenu = insertMenu->addMenu(tr("Mosaics hold"));
|
||||||
QAction *mosaicsHoldAct = mosaicsHoldSubMenu->addAction(tr("Hold mosaics"));
|
QAction *mosaicsHoldAct = mosaicsHoldSubMenu->addAction(tr("Hold mosaics"));
|
||||||
mosaicsHoldAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_H));
|
mosaicsHoldAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::SHIFT | Qt::Key_H));
|
||||||
mosaicsHoldAct->setStatusTip(tr("Insert hold mosaics attribute"));
|
mosaicsHoldAct->setStatusTip(tr("Insert hold mosaics attribute"));
|
||||||
connect(mosaicsHoldAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1e); });
|
connect(mosaicsHoldAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1e); });
|
||||||
QAction *mosaicsReleaseAct = mosaicsHoldSubMenu->addAction(tr("Release mosaics"));
|
QAction *mosaicsReleaseAct = mosaicsHoldSubMenu->addAction(tr("Release mosaics"));
|
||||||
@@ -616,7 +616,7 @@ void MainWindow::createActions()
|
|||||||
|
|
||||||
QMenu *backgroundColourSubMenu = insertMenu->addMenu(tr("Background colour"));
|
QMenu *backgroundColourSubMenu = insertMenu->addMenu(tr("Background colour"));
|
||||||
QAction *backgroundNewAct = backgroundColourSubMenu->addAction(tr("New background"));
|
QAction *backgroundNewAct = backgroundColourSubMenu->addAction(tr("New background"));
|
||||||
backgroundNewAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_N));
|
backgroundNewAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::SHIFT | Qt::Key_N));
|
||||||
backgroundNewAct->setStatusTip(tr("Insert new background attribute"));
|
backgroundNewAct->setStatusTip(tr("Insert new background attribute"));
|
||||||
connect(backgroundNewAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1d); });
|
connect(backgroundNewAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1d); });
|
||||||
QAction *backgroundBlackAct = backgroundColourSubMenu->addAction(tr("Black background"));
|
QAction *backgroundBlackAct = backgroundColourSubMenu->addAction(tr("Black background"));
|
||||||
@@ -630,15 +630,15 @@ void MainWindow::createActions()
|
|||||||
textSizeNormalAct->setStatusTip(tr("Insert normal size attribute"));
|
textSizeNormalAct->setStatusTip(tr("Insert normal size attribute"));
|
||||||
connect(textSizeNormalAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0c); });
|
connect(textSizeNormalAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0c); });
|
||||||
QAction *textSizeDoubleHeightAct = textSizeSubMenu->addAction(tr("Double height"));
|
QAction *textSizeDoubleHeightAct = textSizeSubMenu->addAction(tr("Double height"));
|
||||||
textSizeDoubleHeightAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_D));
|
textSizeDoubleHeightAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::SHIFT | Qt::Key_D));
|
||||||
textSizeDoubleHeightAct->setStatusTip(tr("Insert double height attribute"));
|
textSizeDoubleHeightAct->setStatusTip(tr("Insert double height attribute"));
|
||||||
connect(textSizeDoubleHeightAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0d); });
|
connect(textSizeDoubleHeightAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0d); });
|
||||||
QAction *textSizeDoubleWidthAct = textSizeSubMenu->addAction(tr("Double width"));
|
QAction *textSizeDoubleWidthAct = textSizeSubMenu->addAction(tr("Double width"));
|
||||||
textSizeDoubleWidthAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::CTRL + Qt::Key_D));
|
textSizeDoubleWidthAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::CTRL | Qt::Key_D));
|
||||||
textSizeDoubleWidthAct->setStatusTip(tr("Insert double width attribute"));
|
textSizeDoubleWidthAct->setStatusTip(tr("Insert double width attribute"));
|
||||||
connect(textSizeDoubleWidthAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0e); });
|
connect(textSizeDoubleWidthAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0e); });
|
||||||
QAction *textSizeDoubleSizeAct = textSizeSubMenu->addAction(tr("Double size"));
|
QAction *textSizeDoubleSizeAct = textSizeSubMenu->addAction(tr("Double size"));
|
||||||
textSizeDoubleSizeAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::CTRL + Qt::SHIFT + Qt::Key_D));
|
textSizeDoubleSizeAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::CTRL | Qt::SHIFT | Qt::Key_D));
|
||||||
textSizeDoubleSizeAct->setStatusTip(tr("Insert double size attribute"));
|
textSizeDoubleSizeAct->setStatusTip(tr("Insert double size attribute"));
|
||||||
connect(textSizeDoubleSizeAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0f); });
|
connect(textSizeDoubleSizeAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0f); });
|
||||||
|
|
||||||
@@ -649,7 +649,7 @@ void MainWindow::createActions()
|
|||||||
|
|
||||||
QMenu *flashSubMenu = insertMenu->addMenu(tr("Flash"));
|
QMenu *flashSubMenu = insertMenu->addMenu(tr("Flash"));
|
||||||
QAction *flashFlashingAct = flashSubMenu->addAction(tr("Flashing"));
|
QAction *flashFlashingAct = flashSubMenu->addAction(tr("Flashing"));
|
||||||
flashFlashingAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_F));
|
flashFlashingAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::SHIFT | Qt::Key_F));
|
||||||
flashFlashingAct->setStatusTip(tr("Insert flashing attribute"));
|
flashFlashingAct->setStatusTip(tr("Insert flashing attribute"));
|
||||||
connect(flashFlashingAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x08); });
|
connect(flashFlashingAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x08); });
|
||||||
QAction *flashSteadyAct = flashSubMenu->addAction(tr("Steady"));
|
QAction *flashSteadyAct = flashSubMenu->addAction(tr("Steady"));
|
||||||
@@ -659,7 +659,7 @@ void MainWindow::createActions()
|
|||||||
|
|
||||||
QMenu *boxingSubMenu = insertMenu->addMenu(tr("Box"));
|
QMenu *boxingSubMenu = insertMenu->addMenu(tr("Box"));
|
||||||
QAction *boxingStartAct = boxingSubMenu->addAction(tr("Start box"));
|
QAction *boxingStartAct = boxingSubMenu->addAction(tr("Start box"));
|
||||||
boxingStartAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::SHIFT + Qt::Key_X));
|
boxingStartAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::SHIFT | Qt::Key_X));
|
||||||
boxingStartAct->setStatusTip(tr("Insert start box attribute"));
|
boxingStartAct->setStatusTip(tr("Insert start box attribute"));
|
||||||
connect(boxingStartAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0b); });
|
connect(boxingStartAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0b); });
|
||||||
QAction *boxingEndAct = boxingSubMenu->addAction(tr("End box"));
|
QAction *boxingEndAct = boxingSubMenu->addAction(tr("End box"));
|
||||||
@@ -668,7 +668,7 @@ void MainWindow::createActions()
|
|||||||
connect(boxingEndAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0a); });
|
connect(boxingEndAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x0a); });
|
||||||
|
|
||||||
QAction *escSwitchAct = insertMenu->addAction(tr("ESC/switch"));
|
QAction *escSwitchAct = insertMenu->addAction(tr("ESC/switch"));
|
||||||
escSwitchAct->setShortcut(QKeySequence(Qt::Key_Escape, Qt::CTRL + Qt::Key_S));
|
escSwitchAct->setShortcut(QKeySequence(Qt::NoModifier | Qt::Key_Escape, Qt::CTRL | Qt::Key_S));
|
||||||
escSwitchAct->setStatusTip(tr("Insert ESC/switch character set attribute"));
|
escSwitchAct->setStatusTip(tr("Insert ESC/switch character set attribute"));
|
||||||
connect(escSwitchAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1b); });
|
connect(escSwitchAct, &QAction::triggered, [=]() { m_textWidget->setCharacter(0x1b); });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user