This commit is contained in:
2025-09-28 17:05:51 +08:00
parent 8eb80ab66d
commit d97fa3e0fe
398 changed files with 18737 additions and 0 deletions

View File

@@ -0,0 +1,76 @@
// Copyright (c) Daniel Gakwaya.
// SPDX-License-Identifier: MIT
import QtQuick
import QtQuick.Window
import QtQuick.Dialogs
import QtQuick.Controls
Window {
visible: true
width: 640
height: 480
title: qsTr("FontDialog Demo")
Column {
spacing: 20
anchors.centerIn: parent
Button{
text: "Change Font"
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
fontDialogId.open()
}
}
Text {
id: textId
text: "Hello World"
}
FontDialog{
id: fontDialogId
title: "Choose Font"
currentFont: Qt.font({ family: "Arial", pointSize: 24, weight: Font.Normal })
onAccepted: {
console.log("Chose font: "+selectedFont)
textId.font = fontDialogId.selectedFont
}
onRejected: {
console.log("Dialog rejected")
}
}
}
}