From 7aebe273da3444164edd3b893775268bedccdfa3 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周六, 27 4月 2024 21:42:51 +0800 Subject: [PATCH] Merge branch 'main' of github.com:stdware/qwindowkit --- README.md | 20 ++++++++++++++++++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b47a9a7..9268a82 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ #### CMake Project ```sh -cmake -B build -DQWindowKit_DIR=/path/install/cmake/QWindowKit +cmake -B build -DQWindowKit_DIR=/path/install/lib/cmake/QWindowKit ``` ```cmake @@ -133,6 +133,21 @@ ## Quick Start ### Qt Widgets Application + +#### Initialization + +The following initialization should be done before any widget constructs. + +```cpp +#include <QtWidgets/QApplication> + +int main(int argc, char *argv[]) +{ + QGuiApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings) + + // ... +} +``` #### Setup Window Agent @@ -259,7 +274,8 @@ ### 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 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. ++ 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 -- Gitblit v1.9.1