Compare commits

...

2 Commits

Author SHA1 Message Date
Yuhang Zhao 27a9e0857c widget: minor simply 2023-09-26 12:47:23 +08:00
Yuhang Zhao 79d5087df5 quick: fix qml import error
Fixes: #288
Fixes: #233
2023-09-26 12:42:32 +08:00
2 changed files with 4 additions and 4 deletions

View File

@ -155,9 +155,9 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.3")
#NO_RESOURCE_TARGET_PATH # Can't be used for non-executable targets. #NO_RESOURCE_TARGET_PATH # Can't be used for non-executable targets.
OUTPUT_TARGETS __qml_targets OUTPUT_TARGETS __qml_targets
IMPORTS IMPORTS
QtQml/auto QtQml
QtQuick/auto QtQuick
QtQuick.Controls.Basic/auto QtQuick.Controls.Basic
) )
if(__qml_targets) if(__qml_targets)
list(APPEND __export_targets ${__qml_targets}) list(APPEND __export_targets ${__qml_targets})

View File

@ -69,7 +69,7 @@ static inline void emulateLeaveEvent(QWidget *widget)
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
const QScreen *screen = widget->screen(); const QScreen *screen = widget->screen();
#else #else
const QScreen *screen = QGuiApplication::primaryScreen(); const QScreen *screen = widget->windowHandle()->screen();
#endif #endif
const QPoint globalPos = QCursor::pos(screen); const QPoint globalPos = QCursor::pos(screen);
if (!QRect(widget->mapToGlobal(QPoint{ 0, 0 }), widget->size()).contains(globalPos)) { if (!QRect(widget->mapToGlobal(QPoint{ 0, 0 }), widget->size()).contains(globalPos)) {