TODO: port to QKeyCombination to fix "warning: bitwise operation between different enumeration types ‘Qt::Modifier’ and ‘Qt::Key’ is deprecated"
This warnings flood the build (> 100):
/home/bam/kde/src/kwin/src/effects/tileseditor/kcm/tileseditoreffectkcm.cpp:35: warning: bitwise operation between different enumeration types ‘Qt::Modifier’ and ‘Qt::Key’ is deprecated [-Wdeprecated-enum-enum-conversion]
/home/bam/kde/src/kwin/src/effects/tileseditor/kcm/tileseditoreffectkcm.cpp: In constructor ‘KWin::TilesEditorEffectConfig::TilesEditorEffectConfig(QWidget*, const QVariantList&)’:
/home/bam/kde/src/kwin/src/effects/tileseditor/kcm/tileseditoreffectkcm.cpp:35:57: warning: bitwise operation between different enumeration types ‘Qt::Modifier’ and ‘Qt::Key’ is deprecated [-Wdeprecated-enum-enum-conversion]
35 | const QKeySequence defaultToggleShortcut = Qt::META | Qt::Key_T;
| ~~~~~~~~~^~~~~~~~~~~
In Qt6 the solution is QKeyCombination:
https://doc.qt.io/qt-6/gui-changes-qt6.html#the-qkeycombination-class
QKeyCombination is a new class for storing a combination of a key with an optional modifier. It should be used as a replacement for combining values from the Qt::Key enum with a modifier in a type-safe way.
We recommend migrating code that currently uses operator+() to combine a key and modifiers, as future C++ standards are likely to declare arithmetic operations between unrelated enumeration types as illegal. Use operator|(), and change APIs that expect an int to expect a QKeyCombination instead.
Existing APIs that expect an int for a key combination can be called using QKeyCombination::toCombined().
The description mentions operator+()
but as we see bitwise operation is also suffered.