diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index c492e461ec..0db6b3cf9e 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -1192,6 +1192,7 @@ SET(FreeCADGui_SRCS SpaceballEvent.h PreferencePackManager.h Thumbnail.h + Tools.h Utilities.h WaitCursor.h ManualAlignment.h diff --git a/src/Gui/Tools.h b/src/Gui/Tools.h index f09d11cbd3..f90b87675c 100644 --- a/src/Gui/Tools.h +++ b/src/Gui/Tools.h @@ -24,6 +24,9 @@ #define GUI_TOOLS_H #include +#include +#include +#include namespace Gui { @@ -47,6 +50,10 @@ public: return fm.width(text, len); #endif } + static bool matches(QKeyEvent* ke, const QKeySequence& ks) { + uint searchkey = (ke->modifiers() | ke->key()) & ~(Qt::KeypadModifier | Qt::GroupSwitchModifier); + return ks == QKeySequence(searchkey); + } }; } // namespace Gui