From 027122452a25191b81fef8fe35f5b54768d435f2 Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周六, 02 12月 2023 01:54:24 +0800
Subject: [PATCH] Add windows implementations

---
 src/widgets/widgetwindowagent.cpp |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/widgets/widgetwindowagent.cpp b/src/widgets/widgetwindowagent.cpp
index d3200a7..9726e4b 100644
--- a/src/widgets/widgetwindowagent.cpp
+++ b/src/widgets/widgetwindowagent.cpp
@@ -21,20 +21,23 @@
     WidgetWindowAgent::~WidgetWindowAgent() {
     }
 
-    void WidgetWindowAgent::setup(QWidget *w) {
+    bool WidgetWindowAgent::setup(QWidget *w) {
         Q_ASSERT(w);
         if (!w) {
-            return;
+            return false;
         }
 
         Q_D(WidgetWindowAgent);
         if (d->host) {
-            return;
+            return false;
         }
-        d->host = w;
 
         std::ignore = w->winId(); // Make sure the window handle is created
-        d->setup(w->windowHandle(), new WidgetItemDelegate());
+        if (!d->setup(w->windowHandle(), new WidgetItemDelegate())) {
+            return true;
+        }
+        d->host = w;
+        return true;
     }
 
     bool WidgetWindowAgent::isHitTestVisible(QWidget *w) const {

--
Gitblit v1.9.1