Add prefix to PLATFORM_SPECIFIC_CAPSLOCK_DETECTION macro
This commit is contained in:
parent
27b132f39a
commit
31ac09de87
|
@ -123,13 +123,13 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" "${CMAKE_MODUL
|
||||||
# configure platform specific capslock detection
|
# configure platform specific capslock detection
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# WinAPI provides functions required for capslock detection
|
# WinAPI provides functions required for capslock detection
|
||||||
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS PLATFORM_SPECIFIC_CAPSLOCK_DETECTION)
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION)
|
||||||
else()
|
else()
|
||||||
# X11 can provide functions required for capslock detection under non-Windows environments
|
# X11 can provide functions required for capslock detection under non-Windows environments
|
||||||
find_package(X11)
|
find_package(X11)
|
||||||
if(X11_FOUND)
|
if(X11_FOUND)
|
||||||
list(APPEND LIBRARIES ${X11_LIBRARIES})
|
list(APPEND LIBRARIES ${X11_LIBRARIES})
|
||||||
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS PLATFORM_SPECIFIC_CAPSLOCK_DETECTION)
|
list(APPEND META_PRIVATE_COMPILE_DEFINITIONS QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
#ifdef PLATFORM_SPECIFIC_CAPSLOCK_DETECTION
|
#ifdef QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION
|
||||||
# if defined(Q_OS_WIN32)
|
# if defined(Q_OS_WIN32)
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# elif defined(X_AVAILABLE)
|
# elif defined(X_AVAILABLE)
|
||||||
|
@ -49,7 +49,7 @@ EnterPasswordDialog::EnterPasswordDialog(QWidget *parent) :
|
||||||
m_ui->password1LineEdit->installEventFilter(this);
|
m_ui->password1LineEdit->installEventFilter(this);
|
||||||
m_ui->password2LineEdit->installEventFilter(this);
|
m_ui->password2LineEdit->installEventFilter(this);
|
||||||
// capslock key detection
|
// capslock key detection
|
||||||
#ifdef PLATFORM_SPECIFIC_CAPSLOCK_DETECTION
|
#ifdef QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION
|
||||||
m_capslockPressed = isCapslockPressed();
|
m_capslockPressed = isCapslockPressed();
|
||||||
#else
|
#else
|
||||||
m_capslockPressed = false;
|
m_capslockPressed = false;
|
||||||
|
@ -302,14 +302,14 @@ void EnterPasswordDialog::confirm()
|
||||||
*
|
*
|
||||||
* \remarks - Returns always false for unsupported platforms.
|
* \remarks - Returns always false for unsupported platforms.
|
||||||
* - This method always returns false when not built with
|
* - This method always returns false when not built with
|
||||||
* PLATFORM_SPECIFIC_CAPSLOCK_DETECTION defined.
|
* QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION defined.
|
||||||
* - This static function will be used internally to detect whether the capslock key is pressed
|
* - This static function will be used internally to detect whether the capslock key is pressed
|
||||||
* when initializing the dialog if available.
|
* when initializing the dialog if available.
|
||||||
* - The function requires the application to be linked against X11 on Linux/Unix.
|
* - The function requires the application to be linked against X11 on Linux/Unix.
|
||||||
*/
|
*/
|
||||||
bool EnterPasswordDialog::isCapslockPressed()
|
bool EnterPasswordDialog::isCapslockPressed()
|
||||||
{
|
{
|
||||||
#ifdef PLATFORM_SPECIFIC_CAPSLOCK_DETECTION
|
#ifdef QT_UTILITIES_PLATFORM_SPECIFIC_CAPSLOCK_DETECTION
|
||||||
// platform dependent method of determining if CAPS LOCK is pressed
|
// platform dependent method of determining if CAPS LOCK is pressed
|
||||||
# if defined(Q_OS_WIN32)
|
# if defined(Q_OS_WIN32)
|
||||||
return GetKeyState(VK_CAPITAL) == 1;
|
return GetKeyState(VK_CAPITAL) == 1;
|
||||||
|
|
Loading…
Reference in New Issue