win: don't repaint superflus

This commit is contained in:
Zhao Yuhang 2023-10-19 19:51:53 +08:00
parent 3ed04dedeb
commit aa489b25d0
3 changed files with 48 additions and 40 deletions

View File

@ -40,9 +40,6 @@ foreach(_component ${@PROJECT_NAME@_FIND_COMPONENTS})
if(EXISTS "${__targets_file}")
include("${__targets_file}")
add_library(${__target} ALIAS @PROJECT_NAME@::${__target_full})
if(NOT "x${_component}" STREQUAL "xCore")
list(APPEND _@PROJECT_NAME@_available_components ${_component})
endif()
else()
set(@PROJECT_NAME@_FOUND FALSE)
set(@PROJECT_NAME@_NOT_FOUND_MESSAGE "Can't find necessary configuration file for ${__target}, please make sure this component is built successfully and installed properly.")
@ -76,6 +73,7 @@ set_package_properties(@PROJECT_NAME@ PROPERTIES
)
if(${@PROJECT_NAME@_FOUND})
list(REMOVE_DUPLICATES _@PROJECT_NAME@_available_components)
find_dependency(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS ${_@PROJECT_NAME@_available_components})
find_dependency(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${_@PROJECT_NAME@_available_components})
endif()

View File

@ -409,6 +409,11 @@ void FramelessQuickHelperPrivate::repaintAllChildren()
void FramelessQuickHelperPrivate::doRepaintAllChildren()
{
repaintTimer.stop();
static bool firstTime = true;
if (firstTime) {
firstTime = false;
} else {
Q_Q(const FramelessQuickHelper);
QQuickWindow *window = q->window();
if (!window) {
@ -441,7 +446,7 @@ void FramelessQuickHelperPrivate::doRepaintAllChildren()
}
}
#endif
repaintTimer.stop();
}
}
quint32 FramelessQuickHelperPrivate::readyWaitTime() const

View File

@ -374,15 +374,20 @@ void FramelessWidgetsHelperPrivate::repaintAllChildren()
void FramelessWidgetsHelperPrivate::doRepaintAllChildren()
{
repaintTimer.stop();
if (!window) {
return;
}
static bool firstTime = true;
if (firstTime) {
firstTime = false;
} else {
forceWidgetRepaint(window);
const QList<QWidget *> widgets = window->findChildren<QWidget *>();
for (auto &&widget : std::as_const(widgets)) {
forceWidgetRepaint(widget);
}
repaintTimer.stop();
}
}
quint32 FramelessWidgetsHelperPrivate::readyWaitTime() const