diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index aa530c5f08c..eb7a6074cf2 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -176,14 +176,19 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = { // StandardKey Priority Key Sequence Platforms {QKeySequence::HelpContents, 1, Qt::CTRL | Qt::Key_Question, KB_Mac}, {QKeySequence::HelpContents, 0, Qt::Key_F1, KB_Win | KB_X11}, + {QKeySequence::HelpContents, 0, Qt::Key_Help, KB_All}, {QKeySequence::WhatsThis, 1, Qt::SHIFT | Qt::Key_F1, KB_All}, {QKeySequence::Open, 1, Qt::CTRL | Qt::Key_O, KB_All}, + {QKeySequence::Open, 0, Qt::Key_Open, KB_All}, {QKeySequence::Close, 0, Qt::CTRL | Qt::Key_F4, KB_Mac}, {QKeySequence::Close, 1, Qt::CTRL | Qt::Key_F4, KB_Win}, {QKeySequence::Close, 1, Qt::CTRL | Qt::Key_W, KB_Mac}, {QKeySequence::Close, 0, Qt::CTRL | Qt::Key_W, KB_Win | KB_X11}, + {QKeySequence::Close, 0, Qt::Key_Close, KB_All}, {QKeySequence::Save, 1, Qt::CTRL | Qt::Key_S, KB_All}, + {QKeySequence::Save, 0, Qt::Key_Save, KB_All}, {QKeySequence::New, 1, Qt::CTRL | Qt::Key_N, KB_All}, + {QKeySequence::New, 0, Qt::Key_New, KB_All}, {QKeySequence::Delete, 0, Qt::CTRL | Qt::Key_D, KB_X11}, //emacs (line edit only) {QKeySequence::Delete, 1, Qt::Key_Delete, KB_All}, {QKeySequence::Delete, 0, Qt::META | Qt::Key_D, KB_Mac}, @@ -191,33 +196,43 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = { {QKeySequence::Cut, 0, Qt::SHIFT | Qt::Key_Delete, KB_Win | KB_X11}, //## Check if this should work on mac {QKeySequence::Cut, 0, Qt::Key_F20, KB_X11}, //Cut on sun keyboards {QKeySequence::Cut, 0, Qt::META | Qt::Key_K, KB_Mac}, + {QKeySequence::Cut, 0, Qt::Key_Cut, KB_All}, {QKeySequence::Copy, 0, Qt::CTRL | Qt::Key_Insert, KB_X11 | KB_Win}, {QKeySequence::Copy, 1, Qt::CTRL | Qt::Key_C, KB_All}, {QKeySequence::Copy, 0, Qt::Key_F16, KB_X11}, //Copy on sun keyboards + {QKeySequence::Copy, 0, Qt::Key_Copy, KB_All}, {QKeySequence::Paste, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Insert, KB_X11}, {QKeySequence::Paste, 1, Qt::CTRL | Qt::Key_V, KB_All}, {QKeySequence::Paste, 0, Qt::SHIFT | Qt::Key_Insert, KB_Win | KB_X11}, {QKeySequence::Paste, 0, Qt::Key_F18, KB_X11}, //Paste on sun keyboards {QKeySequence::Paste, 0, Qt::META | Qt::Key_Y, KB_Mac}, + {QKeySequence::Paste, 0, Qt::Key_Paste, KB_All}, {QKeySequence::Undo, 0, Qt::ALT | Qt::Key_Backspace, KB_Win}, {QKeySequence::Undo, 1, Qt::CTRL | Qt::Key_Z, KB_All}, {QKeySequence::Undo, 0, Qt::Key_F14, KB_X11}, //Undo on sun keyboards + {QKeySequence::Undo, 0, Qt::Key_Undo, KB_All}, {QKeySequence::Redo, 0, Qt::ALT | Qt::SHIFT | Qt::Key_Backspace,KB_Win}, {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, KB_Mac}, {QKeySequence::Redo, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Z, KB_Win | KB_X11}, {QKeySequence::Redo, 1, Qt::CTRL | Qt::Key_Y, KB_Win}, + {QKeySequence::Redo, 0, Qt::Key_Redo, KB_All}, {QKeySequence::Back, 1, Qt::ALT | Qt::Key_Left, KB_Win | KB_X11}, {QKeySequence::Back, 0, Qt::CTRL | Qt::Key_Left, KB_Mac}, {QKeySequence::Back, 1, Qt::CTRL | Qt::Key_BracketLeft, KB_Mac}, {QKeySequence::Back, 0, Qt::Key_Backspace, KB_Win}, + {QKeySequence::Back, 0, Qt::Key_Back, KB_All}, {QKeySequence::Forward, 1, Qt::ALT | Qt::Key_Right, KB_Win | KB_X11}, {QKeySequence::Forward, 0, Qt::CTRL | Qt::Key_Right, KB_Mac}, {QKeySequence::Forward, 1, Qt::CTRL | Qt::Key_BracketRight, KB_Mac}, {QKeySequence::Forward, 0, Qt::SHIFT | Qt::Key_Backspace, KB_Win}, + {QKeySequence::Forward, 0, Qt::Key_Forward, KB_All}, {QKeySequence::Refresh, 1, Qt::CTRL | Qt::Key_R, KB_Gnome | KB_Mac}, {QKeySequence::Refresh, 0, Qt::Key_F5, KB_Win | KB_X11}, + {QKeySequence::Refresh, 0, Qt::Key_Refresh, KB_All}, {QKeySequence::ZoomIn, 1, Qt::CTRL | Qt::Key_Plus, KB_All}, + {QKeySequence::ZoomIn, 0, Qt::Key_ZoomIn, KB_All}, {QKeySequence::ZoomOut, 1, Qt::CTRL | Qt::Key_Minus, KB_All}, + {QKeySequence::ZoomOut, 0, Qt::Key_ZoomOut, KB_All}, {QKeySequence::Print, 1, Qt::CTRL | Qt::Key_P, KB_All}, {QKeySequence::AddTab, 1, Qt::CTRL | Qt::SHIFT | Qt::Key_N, KB_KDE}, {QKeySequence::AddTab, 0, Qt::CTRL | Qt::Key_T, KB_All}, @@ -234,6 +249,7 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = { {QKeySequence::PreviousChild, 0, Qt::CTRL | Qt::Key_Period, KB_KDE}, {QKeySequence::PreviousChild, 0, Qt::Key_Back, KB_All}, {QKeySequence::Find, 0, Qt::CTRL | Qt::Key_F, KB_All}, + {QKeySequence::Find, 0, Qt::Key_Find, KB_All}, {QKeySequence::FindNext, 0, Qt::CTRL | Qt::Key_G, KB_Win}, {QKeySequence::FindNext, 1, Qt::CTRL | Qt::Key_G, KB_Gnome | KB_Mac}, {QKeySequence::FindNext, 1, Qt::Key_F3, KB_Win}, @@ -326,9 +342,12 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = { {QKeySequence::InsertLineSeparator, 0, Qt::SHIFT | Qt::Key_Return, KB_All}, {QKeySequence::InsertLineSeparator, 0, Qt::META | Qt::Key_O, KB_Mac}, {QKeySequence::SaveAs, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_S, KB_All}, + {QKeySequence::SaveAs, 0, Qt::SHIFT | Qt::Key_Save, KB_All}, {QKeySequence::Preferences, 0, Qt::CTRL | Qt::Key_Comma, KB_Mac}, {QKeySequence::Preferences, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_Comma, KB_KDE}, + {QKeySequence::Preferences, 0, Qt::Key_Settings, KB_All}, {QKeySequence::Quit, 0, Qt::CTRL | Qt::Key_Q, KB_X11 | KB_Gnome | KB_KDE | KB_Mac}, + {QKeySequence::Quit, 0, Qt::Key_Exit, KB_All}, {QKeySequence::FullScreen, 1, Qt::META | Qt::CTRL | Qt::Key_F, KB_Mac}, {QKeySequence::FullScreen, 0, Qt::ALT | Qt::Key_Enter, KB_Win}, {QKeySequence::FullScreen, 0, Qt::CTRL | Qt::SHIFT | Qt::Key_F, KB_KDE}, @@ -339,7 +358,8 @@ const QKeyBinding QPlatformThemePrivate::keyBindings[] = { {QKeySequence::Backspace, 1, Qt::Key_Backspace, KB_Mac}, {QKeySequence::Backspace, 0, Qt::META | Qt::Key_H, KB_Mac}, {QKeySequence::Cancel, 0, Qt::Key_Escape, KB_All}, - {QKeySequence::Cancel, 0, Qt::CTRL | Qt::Key_Period, KB_Mac} + {QKeySequence::Cancel, 0, Qt::CTRL | Qt::Key_Period, KB_Mac}, + {QKeySequence::Cancel, 0, Qt::Key_Cancel, KB_All} }; const uint QPlatformThemePrivate::numberOfKeyBindings = sizeof(QPlatformThemePrivate::keyBindings)/(sizeof(QKeyBinding)); diff --git a/tests/auto/gui/kernel/qaction/tst_qaction.cpp b/tests/auto/gui/kernel/qaction/tst_qaction.cpp index 4a4d1a75c87..d088607fe20 100644 --- a/tests/auto/gui/kernel/qaction/tst_qaction.cpp +++ b/tests/auto/gui/kernel/qaction/tst_qaction.cpp @@ -235,17 +235,18 @@ void tst_QAction::setStandardKeys() QCOMPARE(act.shortcut(), act.shortcuts().constFirst()); QList expected; + const QKeySequence copy = QKeySequence(QStringLiteral("Copy")); const QKeySequence ctrlC = QKeySequence(QStringLiteral("CTRL+C")); const QKeySequence ctrlInsert = QKeySequence(QStringLiteral("CTRL+INSERT")); switch (m_keyboardScheme) { case QPlatformTheme::MacKeyboardScheme: - expected << ctrlC; + expected << ctrlC << copy; break; case QPlatformTheme::WindowsKeyboardScheme: - expected << ctrlC << ctrlInsert; + expected << ctrlC<< ctrlInsert << copy ; break; default: // X11 - expected << ctrlC << ctrlInsert << QKeySequence(QStringLiteral("F16")); + expected << ctrlC << ctrlInsert << QKeySequence(QStringLiteral("F16")) << copy; break; } diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp index 67fef3cf448..6b74cca53f6 100644 --- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp @@ -348,17 +348,18 @@ void tst_QKeySequence::keyBindings() QKeySequence::keyBindings(QKeySequence::Copy); QList expected; + const QKeySequence copy = QKeySequence(QStringLiteral("Copy")); const QKeySequence ctrlC = QKeySequence(QStringLiteral("CTRL+C")); const QKeySequence ctrlInsert = QKeySequence(QStringLiteral("CTRL+INSERT")); switch (m_keyboardScheme) { case QPlatformTheme::MacKeyboardScheme: - expected << ctrlC; + expected << ctrlC << copy; break; case QPlatformTheme::WindowsKeyboardScheme: - expected << ctrlC << ctrlInsert; + expected << ctrlC << ctrlInsert << copy; break; default: // X11 - expected << ctrlC << ctrlInsert << QKeySequence(QStringLiteral("F16")); + expected << ctrlC << ctrlInsert << QKeySequence(QStringLiteral("F16")) << copy; break; } QCOMPARE(bindings, expected);