From c77ab1212bd9a356ddeb03af6bb17c0bdf8ed955 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <zhaoyuhang@rankyee.com> Date: 周一, 11 12月 2023 15:56:59 +0800 Subject: [PATCH] tweak quick API --- examples/qml/main.qml | 34 +++++++++++++++++++++++++++++++++- 1 files changed, 33 insertions(+), 1 deletions(-) diff --git a/examples/qml/main.qml b/examples/qml/main.qml index b319421..7f5c228 100644 --- a/examples/qml/main.qml +++ b/examples/qml/main.qml @@ -1,9 +1,41 @@ import QtQuick 2.15 import QtQuick.Window 2.15 +import QtQuick.Controls 2.15 +import QWindowKit 1.0 Window { id: window - visible: true width: 640 height: 480 + color: "#f0f0f0" + title: qsTr("Hello, world!") + Component.onCompleted: { + windowAgent.setup(window) + window.visible = true + } + + WindowAgent { + id: windowAgent + } + + Rectangle { + id: titleBar + anchors { + top: parent.top + left: parent.left + right: parent.right + } + height: 32 + color: "white" + Component.onCompleted: windowAgent.setTitleBar(titleBar) + + Text { + anchors.centerIn: parent + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: window.title + font.pixelSize: 14 + color: window.active ? "black" : "gray" + } + } } \ No newline at end of file -- Gitblit v1.9.1