Skycoder42 / QHotkey

A global shortcut/hotkey for Desktop Qt-Applications
BSD 3-Clause "New" or "Revised" License
548 stars 161 forks source link

Add support for Qt6 #51

Closed dbermond closed 2 years ago

dbermond commented 2 years ago

Added changes for Qt6. The source code can be used with either Qt5 or Qt6.

Works fine for me with Qt 6.2.0 RC2 and Qt 5.15.2+kde+r227.

Tested on Arch Linux x86_64 with gcc 11.1.0. No compiler warnings.

How to build:

CMake: The QT_MAJOR CMake variable controls which major version of Qt is used for building. For example, specify -DQT_MAJOR=6 as a CMake command line option for building with Qt6. Defaults to 5, so nothing changes when using the default cmake invocation, as it will default to search/build for Qt5.

qmake: Just build in the usual way with qmake6 && make or qmake-qt5 && make.

When building with Qt6 on GNU/Linux and similar UNIXes, the minimium required Qt version is 6.2.0, as Qt 6.1 and 6.0 lacks support for getting the X11 display.

Closes #49

Shatur commented 2 years ago

Feel free to send any other code modernizations :)

dbermond commented 2 years ago

Thank you for merging this!

Feel free to send any other code modernizations :)

I will, thank you :)