Sine Striker
2024-03-07 adc91610761971a86a8ecca83017236eeffebb3d
Fix quick
2个文件已修改
25 ■■■■ 已修改文件
README.md 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/quick/quickwindowagent_win.cpp 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md
@@ -134,6 +134,21 @@
### 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
First, setup `WidgetWindowAgent` for your top `QWidget` instance. (Each window needs its own agent.)
@@ -259,9 +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.
+ 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.
    + If you want to show a non-modal dialog as a child of a frameless window, you should call `QGuiApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings)` before the dialog constructs or in the very beginning in the main entry.
## TODO
src/quick/quickwindowagent_win.cpp
@@ -76,7 +76,12 @@
#  if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
        if (auto api = window()->rendererInterface()->graphicsApi();
            !(api == QSGRendererInterface::Direct3D11 || api == QSGRendererInterface::Direct3D12)) {
            !(api == QSGRendererInterface::Direct3D11
#    if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
              || api == QSGRendererInterface::Direct3D12
#    endif
              )) {
#  endif
            QRect rect(QPoint(0, 0), size().toSize());
            QRegion region(rect);