Sine Striker
2024-05-07 fcdd5e1b8487a36c4adfa665e0a39c883478b654
README.md
@@ -46,7 +46,7 @@
|:---------:|:-----------:|:-------------------------:|
|    Qt     |   \>=5.12   | Core, Gui, Widgets, Quick |
| Compiler  |  \>=C++17   |   MSVC 2019, GCC, Clang   |
|   CMake   |   \>=3.17   |   >=3.20 is recommended   |
|   CMake   |   \>=3.19   |   >=3.20 is recommended   |
### Tested Compilers
@@ -65,27 +65,13 @@
## Integrate
### Configure Options
+ `QWINDOWKIT_BUILD_DOCUMENTATIONS`
    + If you have installed `Doxygen`, you can **enable** this option so that the documentations will also be built and installed.
    + If not, you can read the comments in *qdoc* style in `cpp` files to get detailed usages of the public APIs.
+ `QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS`
    + If you don't want the system borders on Windows 10/11, you can **disable** this option.
    + If so, the Windows 10 top border issue will disappear. However, part of the client edge area will be occupied as the resizing margins.
+ `QWINDOWKIT_ENABLE_QT_WINDOW_CONTEXT`
    + If you want to use pure Qt emulated frameless implementation, you can **enable** this option.
    + If so, all system native features will be lost.
+ `QWINDOWKIT_ENABLE_STYLE_AGENT`
    + Select whether to exclude the style component by **disabling** this option according to your requirements and your Qt version.
### 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"
@@ -104,11 +90,11 @@
#### CMake Project
```sh
cmake -B build -DQWindowKit_DIR=/path/install/cmake/QWindowKit
cmake -B build -DQWindowKit_DIR=/path/install/lib/cmake/QWindowKit
```
```cmake
find_package(QWindowKit REQUIRED)
find_package(QWindowKit COMPONENTS Core Widgets Quick REQUIRED)
target_link_libraries(widgets_app PUBLIC QWindowKit::Widgets)
target_link_libraries(quick_app PUBLIC QWindowKit::Quick)
```
@@ -130,6 +116,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
@@ -237,7 +238,8 @@
        window.visible = true
    }
    WindowAgent {
      // ...
        id: windowAgent
        // ...
    }
}
```
@@ -250,6 +252,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
@@ -264,4 +273,12 @@
## License
QWindowKit is licensed under the Apache 2.0 License.
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.**
-->