mirror of
https://github.com/Ximi1970/systray-x.git
synced 2025-10-26 07:46:09 +01:00
Fix Qt5 build
This commit is contained in:
8
Makefile
8
Makefile
@@ -5,10 +5,10 @@ else
|
||||
ifeq (GNU/Linux,$(shell uname -o))
|
||||
SYSTEM = Linux
|
||||
|
||||
QMAKE = qmake6
|
||||
ifeq (, $(shell which qmake6 2>/dev/null))
|
||||
QMAKE = qmake-qt5
|
||||
ifeq (, $(shell which qmake-qt5 2>/dev/null))
|
||||
QMAKE = qmake-qt5
|
||||
ifeq (, $(shell which qmake-qt5 2>/dev/null))
|
||||
QMAKE = qmake6
|
||||
ifeq (, $(shell which qmake6 2>/dev/null))
|
||||
ifeq (, $(shell which qmake 2>/dev/null))
|
||||
$(error "No qmake in $(PATH)")
|
||||
endif
|
||||
|
||||
@@ -25,8 +25,7 @@ unix:!macx: {
|
||||
lessThan(QT_MAJOR_VERSION, 6): {
|
||||
QT += dbus KNotifications
|
||||
}
|
||||
else
|
||||
{
|
||||
greaterThan(QT_MAJOR_VERSION, 5): {
|
||||
INCLUDEPATH += /usr/include/KF6/KStatusNotifierItem
|
||||
LIBS += -lKF6StatusNotifierItem
|
||||
}
|
||||
|
||||
@@ -55,9 +55,13 @@ bool NativeEventFilterX11::nativeEventFilter( const QByteArray& eventType, void*
|
||||
*/
|
||||
bool NativeEventFilterX11::connectShortcut( QKeySequence key_seq )
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
Qt::Key key_code = Qt::Key( key_seq[ 0 ] & static_cast< int >( ~Qt::KeyboardModifierMask ) );
|
||||
Qt::KeyboardModifiers key_modifiers = Qt::KeyboardModifiers( key_seq[ 0 ] & static_cast<int>( Qt::KeyboardModifierMask ) );
|
||||
#else
|
||||
Qt::Key key_code = Qt::Key( key_seq[ 0 ].toCombined() & static_cast< int >( ~Qt::KeyboardModifierMask ) );
|
||||
Qt::KeyboardModifiers key_modifiers = Qt::KeyboardModifiers( key_seq[ 0 ].toCombined() & static_cast<int>( Qt::KeyboardModifierMask ) );
|
||||
|
||||
#endif
|
||||
return connectShortcut( key_code, key_modifiers );
|
||||
}
|
||||
|
||||
|
||||
@@ -49,9 +49,13 @@ Shortcut::~Shortcut()
|
||||
*/
|
||||
bool Shortcut::setShortcut( QKeySequence key_seq )
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
Qt::Key key_code = Qt::Key( key_seq[ 0 ] & ~Qt::KeyboardModifierMask );
|
||||
Qt::KeyboardModifiers key_modifiers = Qt::KeyboardModifiers( key_seq[ 0 ] & Qt::KeyboardModifierMask);
|
||||
#else
|
||||
Qt::Key key_code = Qt::Key( key_seq[ 0 ].toCombined() & ~Qt::KeyboardModifierMask );
|
||||
Qt::KeyboardModifiers key_modifiers = Qt::KeyboardModifiers( key_seq[ 0 ].toCombined() & Qt::KeyboardModifierMask);
|
||||
|
||||
#endif
|
||||
return setShortcut( key_code, key_modifiers );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user