2022-08-24 07:25:36 +00:00
|
|
|
// Copyright (C) 2022 The Qt Company Ltd.
|
2024-02-22 14:51:16 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2020-11-16 15:34:56 +00:00
|
|
|
|
2022-08-24 07:25:36 +00:00
|
|
|
import QtCore
|
2020-11-16 15:34:56 +00:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
ApplicationWindow {
|
|
|
|
id: window
|
|
|
|
width: 800
|
|
|
|
height: 600
|
|
|
|
title: "dialogs - style: " + style
|
|
|
|
visible: true
|
|
|
|
|
|
|
|
required property string style
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
|
|
|
x = Screen.width / 2 - width / 2
|
|
|
|
y = Screen.height / 2 - height / 2
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings {
|
|
|
|
id: settings
|
|
|
|
|
|
|
|
property alias useNativeDialogs: useNativeDialogsCheckBox.checked
|
2021-08-11 14:02:14 +00:00
|
|
|
property alias lastTabBarIndex: tabBar.currentIndex
|
2020-11-16 15:34:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Page {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
header: TabBar {
|
|
|
|
id: tabBar
|
|
|
|
|
2022-02-03 14:04:11 +00:00
|
|
|
TabButton {
|
|
|
|
text: qsTr("ColorDialog")
|
|
|
|
}
|
2020-11-16 15:34:56 +00:00
|
|
|
TabButton {
|
|
|
|
text: qsTr("FileDialog")
|
|
|
|
}
|
2021-11-01 14:44:24 +00:00
|
|
|
TabButton {
|
|
|
|
text: qsTr("FolderDialog")
|
|
|
|
}
|
2020-11-16 15:34:56 +00:00
|
|
|
TabButton {
|
2021-03-15 15:05:11 +00:00
|
|
|
text: qsTr("FontDialog")
|
2020-11-16 15:34:56 +00:00
|
|
|
}
|
2021-11-15 16:25:47 +00:00
|
|
|
TabButton {
|
|
|
|
text: qsTr("MessageBox")
|
|
|
|
}
|
2020-11-16 15:34:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
id: scrollView
|
|
|
|
anchors.fill: parent
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
StackLayout {
|
|
|
|
id: stackLayout
|
|
|
|
currentIndex: tabBar.currentIndex
|
|
|
|
width: scrollView.width
|
|
|
|
|
2022-02-03 14:04:11 +00:00
|
|
|
ColorDialogPage {}
|
2020-11-16 15:34:56 +00:00
|
|
|
FileDialogPage {}
|
2021-11-01 14:44:24 +00:00
|
|
|
FolderDialogPage {}
|
2021-03-15 15:05:11 +00:00
|
|
|
FontDialogPage {}
|
2021-11-15 16:25:47 +00:00
|
|
|
MessageDialogPage {}
|
2020-11-16 15:34:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
footer: ToolBar {
|
2021-12-10 13:42:04 +00:00
|
|
|
leftPadding: 12
|
|
|
|
rightPadding: 12
|
|
|
|
|
2020-11-16 15:34:56 +00:00
|
|
|
RowLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: useNativeDialogsCheckBox
|
|
|
|
text: qsTr("Use Native Dialogs (requires restart)")
|
|
|
|
checked: settings.useNativeDialogs
|
2024-01-19 17:06:58 +00:00
|
|
|
Layout.fillWidth: false
|
2020-11-16 15:34:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: qsTr("Open")
|
2024-01-19 17:06:58 +00:00
|
|
|
Layout.fillWidth: false
|
2020-11-16 15:34:56 +00:00
|
|
|
|
|
|
|
onClicked: stackLayout.children[stackLayout.currentIndex].dialog.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|