Skip to content

Commit 1b54d60

Browse files
committed
COMP: Update ctkPythonConsoleTest1 to use operator| for Qt 6 compatibility
This fixes the following warning: ``` /path/to/CTK/Libs/Scripting/Python/Widgets/Testing/Cpp/ctkPythonConsoleTest1.cpp: In function ‘int ctkPythonConsoleTest1(int, char**)’: /path/to/CTK/Libs/Scripting/Python/Widgets/Testing/Cpp/ctkPythonConsoleTest1.cpp:47:49: warning: ‘constexpr QKeyCombination Qt::operator+(Qt::Modifier, Qt::Key)’ is deprecated: Use operator| instead [-Wdeprecated-declarations] 47 | otherShortcuts << QKeySequence(Qt::CTRL + Qt::Key_Space); | ^~~~~~~~~ ```
1 parent 9053e9e commit 1b54d60

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libs/Scripting/Python/Widgets/Testing/Cpp/ctkPythonConsoleTest1.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ int ctkPythonConsoleTest1(int argc, char * argv [] )
4444
pythonConsole.initialize(&pythonManager);
4545

4646
QList<QKeySequence> otherShortcuts;
47+
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
48+
otherShortcuts << QKeySequence(Qt::CTRL | Qt::Key_Space);
49+
#else
4750
otherShortcuts << QKeySequence(Qt::CTRL + Qt::Key_Space);
51+
#endif
4852
otherShortcuts << Qt::Key_F1;
4953
pythonConsole.setCompleterShortcuts(otherShortcuts);
5054
pythonConsole.addCompleterShortcut(Qt::Key_Tab);

0 commit comments

Comments
 (0)