From f14f27f41385fd8593457413de2cf5a9c5c357e9 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周三, 13 12月 2023 18:34:14 +0800
Subject: [PATCH] Change to Apache 2.0 License

---
 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