Sine Striker
2023-12-19 671f88f9a7f5735e1c2bd512a13314d8ae5f929b
minor tweaks
2个文件已修改
13 ■■■■■ 已修改文件
README.md 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
examples/mainwindow/mainwindow.cpp 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md
@@ -143,7 +143,10 @@
Layout to work.
```c++
agent->setSystemButton(QWK::WindowAgent::Base::Maximize, maxButton);
agent->setSystemButton(QWK::WindowAgentBase::WindowIcon, myTitleBar->iconButton());
agent->setSystemButton(QWK::WindowAgentBase::Minimize, myTitleBar->minButton());
agent->setSystemButton(QWK::WindowAgentBase::Maximize, myTitleBar->maxButton());
agent->setSystemButton(QWK::WindowAgentBase::Close, myTitleBar->closeButton());
```
Set hit-test visible hint to let `WidgetWindowAgent` know the widgets that desire to receive mouse events.
@@ -161,9 +164,7 @@
Make sure you have registered QWK into QtQuick:
```cpp
// ...
#include <QWKQuick/qwkquickglobal.h>
// ...
int main(int argc, char *argv[])
{
@@ -175,7 +176,7 @@
}
```
Then you can use QWK data types and classes by importing it's URI:
Then you can use `QWindowKit` data types and classes by importing it's URI:
```qml
import QtQuick 2.15
examples/mainwindow/mainwindow.cpp
@@ -108,6 +108,10 @@
    // 1. Setup window agent
    QWK::WidgetWindowAgent *agent = QWK::setupWidgetWindow(this);
    // Equivalent to:
    // auto agent = new QWK::WidgetWindowAgent(w);
    // agent->setup(w);
    // 2. Construct your title bar
    auto menuBar = []() {
        auto menuBar = new QMenuBar();