diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 8b725210fb..ca75721871 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -352,17 +352,16 @@ void StdCmdFreezeViews::activated(int iMsg) getGuiApplication()->sendMsgToActiveView("GetCamera",&ppReturn); QList acts = pcAction->actions(); - int index = 0; + int index = 1; for (QList::ConstIterator it = acts.begin()+offset; it != acts.end(); ++it, index++) { if (!(*it)->isVisible()) { savedViews++; - QString viewnr = QString(QObject::tr("Restore view &%1")).arg(index+1); + QString viewnr = QString(QObject::tr("Restore view &%1")).arg(index); (*it)->setText(viewnr); (*it)->setToolTip(QString::fromLatin1(ppReturn)); (*it)->setVisible(true); - if (index < 9) { - int accel = Qt::CTRL+Qt::Key_1; - (*it)->setShortcut(accel+index); + if (index < 10) { + (*it)->setShortcut(QKeySequence(QString::fromLatin1("CTRL+%1").arg(index))); } break; } @@ -499,9 +498,8 @@ void StdCmdFreezeViews::onRestoreViews() acts[i+offset]->setText(viewnr); acts[i+offset]->setToolTip(setting); acts[i+offset]->setVisible(true); - if ( i < 9 ) { - int accel = Qt::CTRL+Qt::Key_1; - acts[i+offset]->setShortcut(accel+i); + if (i < 9) { + acts[i+offset]->setShortcut(QKeySequence(QString::fromLatin1("CTRL+%1").arg(i+1))); } } diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 1173484427..7fd9cbf6cf 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -1255,7 +1255,7 @@ void PythonConsole::contextMenuEvent ( QContextMenuEvent * e ) ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General"); - a = menu.addAction(tr("&Copy"), this, SLOT(copy()), Qt::CTRL+Qt::Key_C); + a = menu.addAction(tr("&Copy"), this, SLOT(copy()), QKeySequence(QString::fromLatin1("CTRL+C"))); a->setEnabled(textCursor().hasSelection()); a = menu.addAction(tr("&Copy command"), this, SLOT(onCopyCommand())); @@ -1274,11 +1274,11 @@ void PythonConsole::contextMenuEvent ( QContextMenuEvent * e ) menu.addSeparator(); - a = menu.addAction(tr("&Paste"), this, SLOT(paste()), Qt::CTRL+Qt::Key_V); + a = menu.addAction(tr("&Paste"), this, SLOT(paste()), QKeySequence(QString::fromLatin1("CTRL+V"))); const QMimeData *md = QApplication::clipboard()->mimeData(); a->setEnabled( mayPasteHere && md && canInsertFromMimeData(md)); - a = menu.addAction(tr("Select All"), this, SLOT(selectAll()), Qt::CTRL+Qt::Key_A); + a = menu.addAction(tr("Select All"), this, SLOT(selectAll()), QKeySequence(QString::fromLatin1("CTRL+A"))); a->setEnabled(!document()->isEmpty()); a = menu.addAction(tr("Clear console"), this, SLOT(onClearConsole())); diff --git a/src/Gui/PythonEditor.cpp b/src/Gui/PythonEditor.cpp index c4c5c0ac14..808ec5c6d0 100644 --- a/src/Gui/PythonEditor.cpp +++ b/src/Gui/PythonEditor.cpp @@ -77,10 +77,10 @@ PythonEditor::PythonEditor(QWidget* parent) // set acelerators QShortcut* comment = new QShortcut(this); - comment->setKey(Qt::ALT + Qt::Key_C); + comment->setKey(QKeySequence(QString::fromLatin1("ALT+C"))); QShortcut* uncomment = new QShortcut(this); - uncomment->setKey(Qt::ALT + Qt::Key_U); + uncomment->setKey(QKeySequence(QString::fromLatin1("ALT+U"))); connect(comment, SIGNAL(activated()), this, SLOT(onComment())); @@ -157,8 +157,8 @@ void PythonEditor::contextMenuEvent ( QContextMenuEvent * e ) QMenu* menu = createStandardContextMenu(); if (!isReadOnly()) { menu->addSeparator(); - menu->addAction( tr("Comment"), this, SLOT( onComment() ), Qt::ALT + Qt::Key_C ); - menu->addAction( tr("Uncomment"), this, SLOT( onUncomment() ), Qt::ALT + Qt::Key_U ); + menu->addAction( tr("Comment"), this, SLOT( onComment() ), QKeySequence(QString::fromLatin1("ALT+C"))); + menu->addAction( tr("Uncomment"), this, SLOT( onUncomment() ), QKeySequence(QString::fromLatin1("ALT+U"))); } menu->exec(e->globalPos()); diff --git a/src/Gui/TextEdit.cpp b/src/Gui/TextEdit.cpp index e3dea6ae07..a694c57c66 100644 --- a/src/Gui/TextEdit.cpp +++ b/src/Gui/TextEdit.cpp @@ -45,7 +45,7 @@ TextEdit::TextEdit(QWidget* parent) //Note: Set the correct context to this shortcut as we may use several instances of this //class at a time QShortcut* shortcut = new QShortcut(this); - shortcut->setKey(Qt::CTRL+Qt::Key_Space); + shortcut->setKey(QKeySequence(QString::fromLatin1("CTRL+Space"))); shortcut->setContext(Qt::WidgetShortcut); connect(shortcut, SIGNAL(activated()), this, SLOT(complete()));