forked from github_mirror/framelesshelper
Merge pull request #46 from midnightprioriem/master
Add Qt Quick classes to CMake Configuration, Add fix for addIgnoreObject in child windows
This commit is contained in:
commit
ac30e108a3
|
@ -20,6 +20,8 @@ endif()
|
|||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Gui REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Gui REQUIRED)
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Quick)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Quick)
|
||||
|
||||
set(SOURCES
|
||||
framelesshelper_global.h
|
||||
|
@ -27,6 +29,13 @@ set(SOURCES
|
|||
framelesswindowsmanager.cpp
|
||||
)
|
||||
|
||||
if(TARGET Qt${QT_VERSION_MAJOR}::Quick)
|
||||
list(APPEND SOURCES
|
||||
framelessquickhelper.h
|
||||
framelessquickhelper.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND SOURCES
|
||||
winnativeeventfilter.h
|
||||
|
@ -76,6 +85,11 @@ endif()
|
|||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::GuiPrivate
|
||||
)
|
||||
if(TARGET Qt${QT_VERSION_MAJOR}::Quick)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Quick
|
||||
)
|
||||
endif()
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
|
||||
)
|
||||
|
|
|
@ -873,6 +873,9 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
|
|||
QPointF point = {obj->property("x").toReal(), obj->property("y").toReal()};
|
||||
for (QObject *parent = obj->parent(); parent; parent = parent->parent()) {
|
||||
point += {parent->property("x").toReal(), parent->property("y").toReal()};
|
||||
if (parent->isWindowType()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return point;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue