From fc1566897ffdbe844aed8b85299434e02f79c56e Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Sat, 10 Oct 2020 20:51:07 +0800 Subject: [PATCH] Update. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- main_unix.cpp | 5 ----- main_windows.cpp | 5 ----- winnativeeventfilter.cpp | 2 +- winnativeeventfilter.h | 3 +-- 4 files changed, 2 insertions(+), 13 deletions(-) diff --git a/main_unix.cpp b/main_unix.cpp index 6b0d380..fde5d91 100644 --- a/main_unix.cpp +++ b/main_unix.cpp @@ -36,12 +36,7 @@ int main(int argc, char *argv[]) #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) -#if 0 - QGuiApplication::setHighDpiScaleFactorRoundingPolicy( - Qt::HighDpiScaleFactorRoundingPolicy::Round); -#else // Don't round the scale factor. // This will break QWidget applications because they can't render correctly. // Qt Quick applications won't have this issue. diff --git a/main_windows.cpp b/main_windows.cpp index a57f7ed..fa5e1d6 100644 --- a/main_windows.cpp +++ b/main_windows.cpp @@ -93,12 +93,7 @@ int main(int argc, char *argv[]) // they are still useful on other platforms). QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) -#if 0 - QGuiApplication::setHighDpiScaleFactorRoundingPolicy( - Qt::HighDpiScaleFactorRoundingPolicy::Round); -#else // Don't round the scale factor. // This will break QWidget applications because they can't render correctly. // Qt Quick applications won't have this issue. diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index 6d785e9..d9dfe76 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -1084,7 +1084,7 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType, } else if (!m_framelessWindows.contains(msg->hwnd)) { return false; } - const auto data = reinterpret_cast( + const auto data = reinterpret_cast( WNEF_EXECUTE_WINAPI_RETURN(GetWindowLongPtrW, 0, msg->hwnd, GWLP_USERDATA)); if (!data) { // Work-around a long existing Windows bug. diff --git a/winnativeeventfilter.h b/winnativeeventfilter.h index 0dd3b74..92174cb 100644 --- a/winnativeeventfilter.h +++ b/winnativeeventfilter.h @@ -48,7 +48,7 @@ class FRAMELESSHELPER_EXPORT WinNativeEventFilter : public QAbstractNativeEventF Q_DISABLE_COPY_MOVE(WinNativeEventFilter) public: - using WINDOW = struct _WINDOW + using WINDOWDATA = struct _WINDOWDATA { bool initialized = false, fixedSize = false, mouseTransparent = false, restoreDefaultWindowStyle = false, enableLayeredWindow = false, @@ -58,7 +58,6 @@ public: QList> ignoreObjects = {}, draggableObjects = {}; QSize maximumSize = {}, minimumSize = {}; }; - using WINDOWDATA = WINDOW; enum class SystemMetric { BorderWidth, BorderHeight, TitleBarHeight };