From d522300857fd6d321e657381799804960f7f1678 Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: 周日, 17 12月 2023 18:55:03 +0800 Subject: [PATCH] remove unused workarounds --- src/widgets/widgetwindowagent_win.cpp | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/widgets/widgetwindowagent_win.cpp b/src/widgets/widgetwindowagent_win.cpp index ccac368..3eb9f1e 100644 --- a/src/widgets/widgetwindowagent_win.cpp +++ b/src/widgets/widgetwindowagent_win.cpp @@ -8,7 +8,6 @@ namespace QWK { class WidgetBorderHandler : public QObject, public NativeEventFilter { - Q_OBJECT public: explicit WidgetBorderHandler(QWidget *widget, AbstractWindowContext *ctx) : QObject(ctx), widget(widget), ctx(ctx) { @@ -35,7 +34,7 @@ bool nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) override { Q_UNUSED(eventType) - auto msg = reinterpret_cast<const MSG *>(message); + const auto msg = static_cast<const MSG *>(message); switch (msg->message) { case WM_DPICHANGED: { updateGeometry(); @@ -67,7 +66,7 @@ bool eventFilter(QObject *obj, QEvent *event) override { switch (event->type()) { case QEvent::Paint: { - if (widget->windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) + if (widget->windowState() & (Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen)) break; auto paintEvent = static_cast<QPaintEvent *>(event); @@ -114,5 +113,3 @@ } } - -#include "widgetwindowagent_win.moc" \ No newline at end of file -- Gitblit v1.9.1