remove Q_WS_QWS macro

This commit is contained in:
Xiao Yi Fang 2024-06-24 16:05:41 +08:00
parent 2b9d17251b
commit 9db7b04dd0
3 changed files with 2 additions and 39 deletions

View file

@ -107,7 +107,7 @@ HotkeyStruct::HotkeyStruct( quint32 key_, quint32 key2_, quint32 modifier_, int
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#if !defined( Q_OS_MAC ) && !defined( Q_WS_QWS ) #if !defined( Q_OS_MAC )
HotkeyWrapper::HotkeyWrapper( QObject * parent ): HotkeyWrapper::HotkeyWrapper( QObject * parent ):
QThread( parent ), QThread( parent ),
state2( false ) state2( false )

View file

@ -53,7 +53,6 @@ struct HotkeyStruct
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#if !defined( Q_WS_QWS )
class HotkeyWrapper: public QThread // Thread is actually only used on X11 class HotkeyWrapper: public QThread // Thread is actually only used on X11
{ {
Q_OBJECT Q_OBJECT
@ -168,40 +167,6 @@ signals:
#endif #endif
}; };
#else
class HotkeyWrapper: public QObject
{
Q_OBJECT
friend class QHotkeyApplication;
public:
DEF_EX( exInit, "Hotkey wrapper failed to init", std::exception )
HotkeyWrapper( QObject * parent ):
QObject( parent )
{
}
bool setGlobalKey( int key, int key2, Qt::KeyboardModifiers modifier, int handle )
{
return true;
}
bool setGlobalKey( QKeySequence const &, int )
{
return true;
}
void unregister() {}
signals:
void hotkeyActivated( int );
};
#endif
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

View file

@ -21,9 +21,7 @@
bool KeyboardState::checkModifiersPressed( int mask ) bool KeyboardState::checkModifiersPressed( int mask )
{ {
#if defined( Q_WS_QWS ) #if defined( Q_OS_WIN32 )
return false;
#elif defined( Q_OS_WIN32 )
return !( ( mask & Alt && !( GetAsyncKeyState( VK_MENU ) & 0x8000 ) ) return !( ( mask & Alt && !( GetAsyncKeyState( VK_MENU ) & 0x8000 ) )
|| ( mask & Ctrl && !( GetAsyncKeyState( VK_CONTROL ) & 0x8000 ) ) || ( mask & Ctrl && !( GetAsyncKeyState( VK_CONTROL ) & 0x8000 ) )