From 367a91dfe060b48b7bd075827ee8d9e5cb4924ac Mon Sep 17 00:00:00 2001
From: Sine Striker <trueful@163.com>
Date: 周一, 25 3月 2024 17:15:14 +0800
Subject: [PATCH] Fix direct winapi call bug

---
 README.md |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/README.md b/README.md
index ed121ce..7deff56 100644
--- a/README.md
+++ b/README.md
@@ -85,7 +85,10 @@
 ### Build & Install
 
 ```sh
-cmake -B build \
+git clone --recursive https://github.com/stdware/qwindowkit
+cd qwindowkit
+
+cmake -B build -S . \
   -Dqmsetup_DIR=<dir> \ # Optional
   -DCMAKE_INSTALL_PREFIX=/path/install \
   -G "Ninja Multi-Config"
@@ -130,6 +133,21 @@
 ## Quick Start
 
 ### Qt Widgets Application
+
+#### Initialization
+
+The following initialization should be done before any widget constructs.
+
+```cpp
+#include <QWKQuick/qwkquickglobal.h>
+
+int main(int argc, char *argv[])
+{
+    QGuiApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings)
+    
+    // ...
+}
+```
 
 #### Setup Window Agent
 
@@ -252,6 +270,13 @@
 + QWindowKit Internals [TODO]
 + [FramelessHelper Related](docs/framelesshelper-related.md)
 
+
+### Vulnerabilities
+
++ Once you have made the window frameless, it will not be able to switch back to the system border.
++ There must not be any internal child widget with `Qt::WA_NativeWindow` property enabled, otherwise the native features and display may be abnormal. Therefore, do not set any widget that has called `QWidget::winId()` or `QWidget::setAttribute(Qt::WA_NativeWindow)` as a descendant of a frameless window.
+    + If you really need to move widgets between different windows, make sure that the widget is not a top-level window and wrap it with a frameless container.
+
 ## TODO
 
 + Fix 5.15 window abnormal behavior
@@ -267,6 +292,10 @@
 
 QWindowKit is licensed under the [Apache 2.0 License](./LICENSE).
 
+<!--
+
 **You MUST keep a copyright notice of QWindowKit in a prominent place on your project, such as the README document and the About Dialog.**
 
 **You MUST NOT remove the license text from the header files and source files of QWindowKit.**
+
+-->

--
Gitblit v1.9.1