adapt to latest qtbase changes

This commit is contained in:
Zhao Yuhang 2023-10-31 19:57:01 +08:00
parent 14dfa52d0b
commit 33a6f0df91
3 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ void FramelessHelperWin::addWindow(const QObject *window)
#if 0 #if 0
data->callbacks->setWindowFlags(data->callbacks->getWindowFlags() | Qt::FramelessWindowHint); data->callbacks->setWindowFlags(data->callbacks->getWindowFlags() | Qt::FramelessWindowHint);
#else #else
# if (QT_VERSION < QT_VERSION_CHECK(6, 5, 3)) # if ((QT_VERSION != QT_VERSION_CHECK(6, 5, 3)) && (QT_VERSION != QT_VERSION_CHECK(6, 6, 0)))
// Qt maintains a frame margin internally, we need to update it accordingly // Qt maintains a frame margin internally, we need to update it accordingly
// otherwise we'll get lots of warning messages when we change the window // otherwise we'll get lots of warning messages when we change the window
// geometry, it will also affect the final window geometry because QPA will // geometry, it will also affect the final window geometry because QPA will

View File

@ -420,7 +420,7 @@ void FramelessQuickHelperPrivate::doRepaintAllChildren()
if (!window) { if (!window) {
return; return;
} }
#if (defined(Q_OS_WINDOWS) && (QT_VERSION < QT_VERSION_CHECK(6, 5, 3))) #if (defined(Q_OS_WINDOWS) && (QT_VERSION != QT_VERSION_CHECK(6, 5, 3)) && (QT_VERSION != QT_VERSION_CHECK(6, 6, 0)))
// Sync the internal window frame margins with the latest DPI, otherwise // Sync the internal window frame margins with the latest DPI, otherwise
// we will get wrong window sizes after the DPI change. // we will get wrong window sizes after the DPI change.
std::ignore = Utils::updateInternalWindowFrameMargins(window, true); std::ignore = Utils::updateInternalWindowFrameMargins(window, true);

View File

@ -161,7 +161,7 @@ static inline void forceWidgetRepaint(QWidget *widget)
if (!widget) { if (!widget) {
return; return;
} }
#if (defined(Q_OS_WINDOWS) && (QT_VERSION < QT_VERSION_CHECK(6, 5, 3))) #if (defined(Q_OS_WINDOWS) && (QT_VERSION != QT_VERSION_CHECK(6, 5, 3)) && (QT_VERSION != QT_VERSION_CHECK(6, 6, 0)))
// There's some additional things to do for top level windows on Windows. // There's some additional things to do for top level windows on Windows.
if (widget->isWindow()) { if (widget->isWindow()) {
// Don't crash if the QWindow instance has not been created yet. // Don't crash if the QWindow instance has not been created yet.