From 3781b8d6a5c8a82a8ffb97383ac5e4b5e8872b0b Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周三, 13 12月 2023 23:45:43 +0800
Subject: [PATCH] Add qwk config

---
 src/quick/quickitemdelegate.cpp |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/quick/quickitemdelegate.cpp b/src/quick/quickitemdelegate.cpp
index 7696a4a..7bd1259 100644
--- a/src/quick/quickitemdelegate.cpp
+++ b/src/quick/quickitemdelegate.cpp
@@ -10,7 +10,7 @@
 
     QuickItemDelegate::~QuickItemDelegate() = default;
 
-    QWindow *QuickItemDelegate::window(const QObject *obj) const {
+    QWindow *QuickItemDelegate::window(QObject *obj) const {
         return static_cast<const QQuickItem *>(obj)->window();
     }
 
@@ -29,8 +29,8 @@
         return QRectF(originPoint, size).toRect();
     }
 
-    QWindow *QuickItemDelegate::hostWindow(const QObject *host) const {
-        return static_cast<QQuickWindow *>(const_cast<QObject *>(host));
+    QWindow *QuickItemDelegate::hostWindow(QObject *host) const {
+        return static_cast<QQuickWindow *>(host);
     }
 
     bool QuickItemDelegate::isHostSizeFixed(const QObject *host) const {
@@ -38,4 +38,8 @@
         return false;
     }
 
+    bool QuickItemDelegate::isWindowActive(const QObject *host) const {
+        return static_cast<const QQuickWindow *>(host)->isActive();
+    }
+
 }
\ No newline at end of file

--
Gitblit v1.9.1