aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/testbench/testbench.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/testbench/testbench.qml')
-rw-r--r--tests/manual/testbench/testbench.qml1145
1 files changed, 373 insertions, 772 deletions
diff --git a/tests/manual/testbench/testbench.qml b/tests/manual/testbench/testbench.qml
index 2ebb9923..d9bf0fe5 100644
--- a/tests/manual/testbench/testbench.qml
+++ b/tests/manual/testbench/testbench.qml
@@ -48,872 +48,473 @@
**
****************************************************************************/
-import QtQuick 2.6
-import QtQuick.Window 2.2
-import QtQuick.Layouts 1.0
-import QtQuick.Controls 2.1
-import QtQuick.Controls.Material 2.1
-import QtQuick.Controls.Universal 2.1
+import QtQuick 2.10
+import QtQuick.Window 2.3
+import QtQuick.Layouts 1.2
+import QtQuick.Controls 2.3
+import QtQuick.Controls.Imagine 2.3
+import Qt.labs.folderlistmodel 2.2
+import Qt.labs.settings 1.0
+
+import App 1.0
ApplicationWindow {
id: window
visible: true
- width: 750
- height: 1000
-
- Component.onCompleted: {
- x = Screen.width / 2 - width / 2
- y = Screen.height / 2 - height / 2
+ width: 1000
+ height: 750
+ title: "Style Testbench - " + settings.style + " Style" + (usingImagineStyle ? imagineTitleText : "")
+
+ Imagine.path: defaultImaginePath
+
+ readonly property bool usingImagineStyle: settings.style.toLowerCase() === "imagine"
+ // Some controls should be visible regardless of whether or not custom assets are lacking for it,
+ // so we use the default assets in some cases.
+ readonly property string defaultImaginePath: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/images/"
+ property bool settingsLoaded: false
+ readonly property string imagineTitleText: " - " + (settings.useCustomImaginePath ? settings.imaginePath : "Default Assets")
+
+ LoggingCategory {
+ id: brief
+ name: "qt.quick.controls.tools.testbench.assetfixer.brief"
}
- Material.theme: themeSwitch.checked ? Material.Dark : Material.Light
- Universal.theme: themeSwitch.checked ? Universal.Dark : Universal.Light
-
- property int controlSpacing: 10
+ Shortcut {
+ sequence: "Ctrl+F"
+ onActivated: searchTextField.forceActiveFocus()
+ }
Shortcut {
sequence: "Ctrl+Q"
onActivated: Qt.quit()
}
- header: ToolBar {
- Material.theme: Material.Dark
+ Action {
+ id: useCustomAssetsAction
+ text: qsTr("Use Custom Assets")
+ shortcut: "Ctrl+Shift+C"
+ enabled: usingImagineStyle
+ checkable: true
+ checked: settings.useCustomImaginePath
+ onTriggered: settings.useCustomImaginePath = !settings.useCustomImaginePath
+ }
- RowLayout {
- anchors.fill: parent
+ Action {
+ id: reloadAssetsAction
+ text: qsTr("Reload Assets")
+ shortcut: "Ctrl+R"
+ enabled: usingImagineStyle
+ onTriggered: assetFixer.reloadAssets()
+ }
- ToolButton {
- text: "Normal"
- hoverEnabled: true
- ToolTip.text: text
- ToolTip.delay: 1000
- ToolTip.visible: hovered
- onClicked: menu.visible ? menu.close() : menu.open()
+ FontMetrics {
+ id: fontMetrics
+ }
- Menu {
- id: menu
- x: 1
- y: 1 + parent.height
+ Settings {
+ id: settings
- MenuItem {
- text: "Option 1"
- checkable: true
- }
- MenuItem {
- text: "Option 2"
- checkable: true
- }
- MenuItem {
- text: "Option 3"
- checkable: true
- }
+ property alias windowX: window.x
+ property alias windowY: window.y
+ property alias windowWidth: window.width
+ property alias windowHeight: window.height
- MenuSeparator {}
+ property string style: "Imagine"
- MenuItem {
- text: "Option A"
- }
- }
- }
- ToolButton {
- text: "Pressed"
- down: true
- hoverEnabled: true
- ToolTip.text: text
- ToolTip.delay: 1000
- ToolTip.visible: hovered
- }
- ToolButton {
- text: "Checked"
- checkable: true
- checked: true
- hoverEnabled: true
- ToolTip.text: text
- ToolTip.delay: 1000
- ToolTip.visible: hovered
- }
- ToolButton {
- text: "Highlighted"
- highlighted: true
- hoverEnabled: true
- ToolTip.text: text
- ToolTip.delay: 1000
- ToolTip.visible: hovered
- }
- ToolButton {
- text: "Disabled"
- enabled: false
- }
-
- ToolSeparator {}
+ property bool useCustomImaginePath
+ property string imaginePath
+ property bool fixImagineAssets
+ property alias imagineDirLastModified: assetFixer.assetDirectoryLastModified
- ToolButton {
- text: "1"
- }
- ToolButton {
- text: "2"
- }
-
- ToolSeparator {}
-
- Item {
- Layout.fillWidth: true
- }
- Label {
- text: "Light/Dark"
- }
- Switch {
- id: themeSwitch
- }
- }
+ Component.onCompleted: settingsLoaded = true
}
- footer: TabBar {
- TabButton {
- text: "Normal"
- }
- TabButton {
- text: "Pressed"
- down: true
- }
- TabButton {
- text: "Disabled"
- enabled: false
- }
+ Settings {
+ id: paletteSettings
+
+ category: "Palette"
+
+ property bool useCustomPalette
+ property string window
+ property string windowText
+ property string base
+ property string text
+ property string button
+ property string buttonText
+ property string brightText
+ property string toolTipBase
+ property string toolTipText
+ property string light
+ property string midlight
+ property string dark
+ property string mid
+ property string shadow
+ property string highlight
+ property string highlightedText
+ property string link
}
- Pane {
- anchors.fill: parent
+ header: ToolBar {
+ // Seems to be necessary to get the default assets to be used here,
+ // though it should inherit the window's path
+ Imagine.path: defaultImaginePath
- Flickable {
+ RowLayout {
anchors.fill: parent
- contentHeight: flow.height
- Flow {
- id: flow
- width: parent.width
- spacing: 30
+ ToolButton {
+ text: "\uf0c9"
+ font.family: "fontawesome"
+ font.pixelSize: Qt.application.font.pixelSize * 1.6
+ onClicked: drawer.open()
+ }
- RowLayout {
- spacing: window.controlSpacing
+ ToolSeparator {}
- Button {
- text: "Normal"
- }
- Button {
- text: "Pressed"
- down: true
- }
- Button {
- text: "Checked"
- checked: true
- }
- Button {
- text: "CH + PR"
- checked: true
- down: true
- }
- Button {
- text: "Disabled"
- enabled: false
- }
- Button {
- text: "CH + DIS"
- enabled: false
- checked: true
- }
- }
+ TextField {
+ id: searchTextField
+ placeholderText: "Search"
+ }
- RowLayout {
- spacing: window.controlSpacing
+ Item {
+ Layout.fillWidth: true
+ }
- Button {
- text: "HI"
- highlighted: true
- }
- Button {
- text: "HI + PR"
- highlighted: true
- down: true
- }
- Button {
- text: "HI + CH"
- highlighted: true
- checked: true
- }
- Button {
- text: "HI+CH+PR"
- highlighted: true
- down: true
- checked: true
- }
- Button {
- text: "HI + DIS"
- highlighted: true
- enabled: false
- }
- Button {
- text: "HI+CH+DIS"
- highlighted: true
- enabled: false
- checked: true
- }
- }
+ ToolButton {
+ id: optionsMenuButton
+ text: "\ue800"
+ font.family: "FontAwesome"
+ font.pixelSize: Qt.application.font.pixelSize * 1.6
+ checked: optionsMenu.visible
+ checkable: true
- RowLayout {
- spacing: window.controlSpacing * 2
+ onClicked: optionsMenu.open()
- Button {
- text: "Normal"
- }
- Button {
- text: "Pressed"
- down: true
- }
- Button {
- text: "Checked"
- checked: true
- }
- Button {
- text: "CH + PR"
- checked: true
- down: true
- }
- Button {
- text: "Disabled"
- enabled: false
- }
- Button {
- text: "CH + DIS"
- enabled: false
- checked: true
- }
- }
+ Menu {
+ id: optionsMenu
+ x: 1
+ y: 1 + parent.height
+ visible: optionsMenuButton.checked
+ closePolicy: Popup.CloseOnPressOutsideParent
- RowLayout {
- spacing: window.controlSpacing * 2
+ Imagine.path: defaultImaginePath
- ColumnLayout {
- RoundButton {
- highlighted: true
- Layout.alignment: Qt.AlignHCenter
- }
- Label {
- text: "HI"
- Layout.alignment: Qt.AlignHCenter
- }
- }
- ColumnLayout {
- RoundButton {
- highlighted: true
- down: true
- Layout.alignment: Qt.AlignHCenter
- }
- Label {
- text: "HI + PR"
- Layout.alignment: Qt.AlignHCenter
- }
- }
- ColumnLayout {
- RoundButton {
- highlighted: true
- checked: true
- Layout.alignment: Qt.AlignHCenter
- }
- Label {
- text: "HI + CH"
- Layout.alignment: Qt.AlignHCenter
- }
- }
- ColumnLayout {
- RoundButton {
- highlighted: true
- down: true
- checked: true
- Layout.alignment: Qt.AlignHCenter
- }
- Label {
- text: "HI+CH+PR"
- Layout.alignment: Qt.AlignHCenter
- }
- }
- ColumnLayout {
- RoundButton {
- highlighted: true
- enabled: false
- Layout.alignment: Qt.AlignHCenter
- }
- Label {
- text: "HI + DIS"
- Layout.alignment: Qt.AlignHCenter
- }
- }
- ColumnLayout {
- RoundButton {
- highlighted: true
- enabled: false
- checked: true
- Layout.alignment: Qt.AlignHCenter
- }
- Label {
- text: "HI+CH+DIS"
- Layout.alignment: Qt.AlignHCenter
- }
+ MenuItem {
+ text: qsTr("Open Asset Directory")
+ onClicked: Qt.openUrlExternally(assetFixer.assetDirectoryUrl)
+ enabled: usingImagineStyle
}
- }
- RowLayout {
- CheckBox {
- text: "Normal"
- }
- CheckBox {
- text: "Pressed"
- down: true
- }
- CheckBox {
- text: "Checked"
- checked: true
- }
- CheckBox {
- text: "CH + PR"
- checked: true
- down: true
- }
- CheckBox {
- text: "Disabled"
- enabled: false
- }
- CheckBox {
- text: "CH + DIS"
- checked: true
- enabled: false
+ MenuItem {
+ action: reloadAssetsAction
}
- }
- RowLayout {
- RadioButton {
- text: "Normal"
- }
- RadioButton {
- text: "Pressed"
- down: true
- }
- RadioButton {
- text: "Checked"
- checked: true
- }
- RadioButton {
- text: "CH + PR"
- checked: true
- down: true
- }
- RadioButton {
- text: "Disabled"
- enabled: false
- }
- RadioButton {
- text: "CH + DIS"
- checked: true
- enabled: false
+ MenuItem {
+ action: useCustomAssetsAction
}
- }
- RowLayout {
- Switch {
- text: "Normal"
- }
- Switch {
- text: "Pressed"
- down: true
- }
- Switch {
- text: "Checked"
- checked: true
- }
- Switch {
- text: "CH + PR"
- checked: true
- down: true
- }
- Switch {
- text: "Disabled"
- enabled: false
- }
- }
+ MenuSeparator {}
- RowLayout {
- ProgressBar {
- value: 0.5
- }
- ProgressBar {
- value: 0.5
- indeterminate: true
- }
- ProgressBar {
- value: 0.5
- enabled: false
+ MenuItem {
+ id: settingsMenuItem
+ text: qsTr("Settings")
+ onTriggered: settingsDialog.open()
}
- }
- RowLayout {
- Slider {
- value: 0.5
- }
- Slider {
- value: 0.5
- pressed: true
- }
- Slider {
- value: 0.5
- enabled: false
- }
- }
+ MenuSeparator {}
- RowLayout {
- RangeSlider {
- first.value: 0.25
- second.value: 0.75
- }
- RangeSlider {
- first.value: 0.25
- first.pressed: true
- second.value: 0.75
- }
- RangeSlider {
- first.value: 0.25
- second.value: 0.75
- enabled: false
+ MenuItem {
+ text: qsTr("Quit")
+ onTriggered: Qt.quit()
}
}
+ }
+ }
+ }
- RowLayout {
- Item {
- implicitWidth: normalGroupBox.width
- implicitHeight: normalTextArea.implicitHeight
+ SettingsDialog {
+ id: settingsDialog
- TextArea {
- id: normalTextArea
- text: "Normal"
- }
- }
- Item {
- implicitWidth: normalGroupBox.width
- implicitHeight: normalTextArea.implicitHeight
+ Imagine.path: defaultImaginePath
+ }
- TextArea {
- placeholderText: "Placeholder"
- }
- }
- Item {
- implicitWidth: normalGroupBox.width
- implicitHeight: normalTextArea.implicitHeight
+ Drawer {
+ id: drawer
+ width: parent.width * 0.33
+ height: window.height
+ focus: false
+ modal: false
- TextArea {
- text: "Disabled"
- enabled: false
- }
- }
- }
+ Label {
+ text: "Drawer contents go here"
+ anchors.centerIn: parent
+ }
+ }
- RowLayout {
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalTextField.implicitHeight
+ AssetFixer {
+ id: assetFixer
+ assetDirectory: settings.imaginePath
+ // Don't start watching until the settings have loaded, as AssetFixer can be completed before it.
+ // AssetFixer needs the settings in order to check the last modified time of the asset directory.
+ // Also, wait until the UI has been rendered for the first time so that we can show our busy indicators, etc.
+ shouldWatch: usingImagineStyle && settings.useCustomImaginePath && settingsLoaded && initialUiRenderDelayTimer.hasRun
+ shouldFix: shouldWatch && settings.fixImagineAssets
+
+ onFixSuggested: fixEmUp()
+ onDelayedFixSuggested: assetFixerFileSystemDelayTimer.restart()
+ onReloadSuggested: reloadAssets()
+
+ function reloadAssets() {
+ console.log(brief, "Reloading assets...")
+ // Clear the model, otherwise ListView will keep the old items around
+ // with the old assets, even after clearing the pixmap cache
+ listView.resettingModel = true
+ listView.model = null
+ window.Imagine.path = ""
+ assetReloadNextFrameTimer.start()
+ }
- TextField {
- id: normalTextField
- text: "Normal"
- }
- }
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalTextField.implicitHeight
+ function fixEmUp() {
+ // This is a bit of a hack, but I can't think of a nice way to solve it.
+ // The problem is that shouldWatch becomes true, causing startWatching() to be called.
+ // If a fix is suggested as a result of that, this function is called.
+ // However, the shouldFix binding hasn't been updated yet, so even though shouldWatch
+ // and settings.fixImagineAssets are both true (the properties that make up its binding),
+ // the if check below fails. So, we check for that case with effectiveShouldFix.
+ var effectiveShouldFix = shouldWatch && settings.fixImagineAssets;
+ if (shouldWatch && effectiveShouldFix && assetDirectory.length > 0) {
+ // Disable image caching if it hasn't already been done.
+ assetFixer.clearImageCache()
+
+ busyIndicatorRow.visible = true
+ assetFixerAnimationDelayTimer.start()
+ }
+ }
+ }
- TextField {
- placeholderText: "Placeholder"
- }
- }
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalTextField.implicitHeight
+ // The controls' assets don't always "reload" if the path is cleared and then set in the same frame,
+ // so we delay the setting to the next frame.
+ Timer {
+ id: assetReloadNextFrameTimer
+ interval: 0
+ onTriggered: {
+ window.Imagine.path = Qt.binding(function() {
+ return settings.useCustomImaginePath && settings.imaginePath.length > 0 ? settings.imaginePath : undefined
+ })
- TextField {
- text: "Disabled"
- enabled: false
- }
- }
- }
+ infoToolTip.text = "Reloaded assets"
+ infoToolTip.timeout = 1500
+ infoToolTip.open()
- RowLayout {
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalSpinBox.implicitHeight
+ listView.model = controlFolderListModel
+ listView.resettingModel = false
- SpinBox {
- id: normalSpinBox
- }
- }
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalSpinBox.implicitHeight
+ console.log(brief, "... reloaded assets.")
+ }
+ }
- SpinBox {
- up.pressed: true
- }
- }
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalSpinBox.implicitHeight
+ // When exporting or deleting a large amount of assets (not uncommon),
+ // the filesystem watcher seems to emit directoryChanged() every second or so,
+ // so rather than process hundreds of assets every time we get notified, delay
+ // it until we haven't been notified for a while.
+ Timer {
+ id: assetFixerFileSystemDelayTimer
+ interval: 2000
+ onRunningChanged: {
+ if (running) {
+ infoToolTip.text = "Assets changed on disk - reloading in 2 seconds if no further changes are detected"
+ infoToolTip.timeout = 2000
+ infoToolTip.open()
+ }
+ }
+ onTriggered: assetFixer.fixEmUp()
+ }
- SpinBox {
- enabled: false
- }
- }
- }
+ // Gives the BusyIndicator animation a chance to start.
+ Timer {
+ id: assetFixerAnimationDelayTimer
+ interval: 100
+ onTriggered: {
+ assetFixer.fixAssets()
+ busyIndicatorRow.visible = false
+ }
+ }
- RowLayout {
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalComboBox.implicitHeight
+ // Gives the UI a chance to render before the initial fixup.
+ Timer {
+ id: initialUiRenderDelayTimer
+ interval: 300
+ running: true
+ onTriggered: hasRun = true
- ComboBox {
- id: normalComboBox
- model: 5
- }
- }
+ property bool hasRun: false
+ }
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalComboBox.implicitHeight
+ function getControlElements(control) {
+ var props = [];
+ for (var p in control) {
+ if (p !== "component" && typeof control[p] === 'object')
+ props.push(p);
+ }
+ return props;
+ }
- ComboBox {
- pressed: true
- model: ListModel {
- ListElement { text: "Pressed" }
- }
- }
- }
+ Pane {
+ id: contentPane
+ anchors.fill: parent
- Item {
- implicitWidth: normalGroupBox.implicitWidth
- implicitHeight: normalComboBox.implicitHeight
+ Imagine.path: settings.useCustomImaginePath && settings.imaginePath.length > 0 ? settings.imaginePath : undefined
+
+ palette.window: effectiveColor(paletteSettings.window)
+ palette.windowText: effectiveColor(paletteSettings.windowText)
+ palette.base: effectiveColor(paletteSettings.base)
+ palette.text: effectiveColor(paletteSettings.text)
+ palette.button: effectiveColor(paletteSettings.button)
+ palette.buttonText: effectiveColor(paletteSettings.buttonText)
+ palette.brightText: effectiveColor(paletteSettings.brightText)
+ palette.toolTipBase: effectiveColor(paletteSettings.toolTipBase)
+ palette.toolTipText: effectiveColor(paletteSettings.toolTipText)
+ palette.light: effectiveColor(paletteSettings.light)
+ palette.midlight: effectiveColor(paletteSettings.midlight)
+ palette.dark: effectiveColor(paletteSettings.dark)
+ palette.mid: effectiveColor(paletteSettings.mid)
+ palette.shadow: effectiveColor(paletteSettings.shadow)
+ palette.highlight: effectiveColor(paletteSettings.highlight)
+ palette.highlightedText: effectiveColor(paletteSettings.highlightedText)
+ palette.link: effectiveColor(paletteSettings.link)
+
+ function effectiveColor(paletteColorString) {
+ return paletteSettings.useCustomPalette && paletteColorString.length > 0 ? paletteColorString : undefined
+ }
- ComboBox {
- enabled: false
- model: ["Disabled"]
- }
- }
- }
+ FolderListModel {
+ id: controlFolderListModel
+ folder: "qrc:/controls"
+ showDirs: false
+ nameFilters: searchTextField.text.length > 0 ? ["*" + searchTextField.text + "*.qml"] : []
+ caseSensitive: false
+ }
- RowLayout {
- GroupBox {
- id: normalGroupBox
- title: "Normal"
+ ListView {
+ id: listView
+ anchors.fill: parent
+ spacing: 30
+ visible: !busyIndicatorRow.visible && !resettingModel
- Item {
- implicitWidth: 200
- implicitHeight: 100
+ property bool resettingModel: false
- BusyIndicator {
- anchors.centerIn: parent
- }
- }
- }
- GroupBox {
- enabled: false
- title: "Disabled"
+ ScrollBar.vertical: ScrollBar {
+ parent: contentPane
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.bottom: parent.bottom
+ }
- Item {
- implicitWidth: 200
- implicitHeight: 100
+ model: controlFolderListModel
+ delegate: ColumnLayout {
+ id: rootDelegate
+ width: parent.width
- BusyIndicator {
- anchors.centerIn: parent
- }
- }
- }
- GroupBox {
- enabled: false
- title: "."
- label.visible: false
-
- Item {
- implicitWidth: 200
- implicitHeight: 100
-
- PageIndicator {
- count: 5
- enabled: false
- anchors.bottom: parent.bottom
- anchors.horizontalCenter: parent.horizontalCenter
- }
- }
- }
+ MenuSeparator {
+ Layout.fillWidth: true
+ visible: index !== 0
}
- RowLayout {
- Frame {
- id: scrollBarFrame
+ Label {
+ text: customControlName.length === 0 ? model.fileBaseName : customControlName
+ font.pixelSize: Qt.application.font.pixelSize * 2
+ }
- Item {
- implicitWidth: 200
- implicitHeight: 100
+ readonly property var controlName: model.fileBaseName
+ readonly property var controlMetaObject: controlMetaObjectLoader.item
+ readonly property string customControlName: controlMetaObject && controlMetaObject.hasOwnProperty("customControlName")
+ ? controlMetaObject.customControlName : ""
+ readonly property var supportedStates: rootDelegate.controlMetaObject.supportedStates
+ readonly property int maxStateCombinations: {
+ var largest = 0;
+ for (var i = 0; i < supportedStates.length; ++i) {
+ var combinations = supportedStates[i];
+ if (combinations.length > largest)
+ largest = combinations.length;
+ }
+ return largest;
+ }
- Label {
- text: "Normal"
- anchors.centerIn: parent
- }
+ Loader {
+ id: controlMetaObjectLoader
+ source: "qrc" + model.filePath
+ }
- ScrollBar {
- size: 0.3
- position: 0.2
- active: true
- orientation: Qt.Vertical
- height: parent.height
- anchors.right: parent.right
- }
- }
- }
+ Flow {
+ spacing: 10
- Frame {
- Item {
- implicitWidth: 200
- implicitHeight: 100
+ Layout.fillWidth: true
- Label {
- text: "Pressed"
- anchors.centerIn: parent
- }
+ Repeater {
+ id: stateRepeater
+ model: rootDelegate.supportedStates
- ScrollBar {
- size: 0.3
- position: 0.2
- active: true
- orientation: Qt.Vertical
- height: parent.height
- anchors.right: parent.right
- pressed: true
- }
- }
- }
+ ColumnLayout {
+ id: labelWithDelegatesColumn
+ spacing: 4
- Frame {
- Item {
- implicitWidth: 200
- implicitHeight: 100
- enabled: false
+ readonly property var states: modelData
+ readonly property string statesAsString: states.join("\n")
Label {
- text: "Disabled"
- anchors.centerIn: parent
- }
+ text: statesAsString.length > 0 ? statesAsString : "normal"
- ScrollBar {
- size: 0.3
- position: 0.2
- active: true
- orientation: Qt.Vertical
- height: parent.height
- anchors.right: parent.right
+ // 4 is the most states for any element (Button)
+ Layout.preferredHeight: (fontMetrics.lineSpacing) * (rootDelegate.maxStateCombinations + 1)
}
- }
- }
- }
- RowLayout {
- Frame {
- Layout.preferredWidth: 100
- Layout.preferredHeight: 100
-
- ScrollIndicator {
- size: 0.3
- position: 0.2
- active: true
- orientation: Qt.Vertical
- height: parent.height
- anchors.right: parent.right
- }
- }
-
- Frame {
- Layout.preferredWidth: 100
- Layout.preferredHeight: 100
-
- ScrollIndicator {
- size: 0.3
- position: 0.2
- active: true
- orientation: Qt.Vertical
- height: parent.height
- anchors.right: parent.right
- enabled: false
- }
- }
- }
+ ControlContainer {
+ id: controlContainer
+ objectName: controlName + "ControlContainer"
+ controlMetaObject: rootDelegate.controlMetaObject
+ states: labelWithDelegatesColumn.states
- RowLayout {
- Frame {
- Tumbler {
- model: 5
- implicitWidth: 80
- implicitHeight: 100
- }
- }
- Frame {
- Tumbler {
- model: 5
- implicitWidth: 80
- implicitHeight: 100
- enabled: false
+ Layout.alignment: Qt.AlignHCenter
+ }
}
}
}
- RowLayout {
- Dial {
- implicitWidth: 100
- implicitHeight: 100
- }
- Dial {
- implicitWidth: 100
- implicitHeight: 100
- enabled: false
- }
- }
+ ExampleContainer {
+ id: exampleContainer
+ controlMetaObject: rootDelegate.controlMetaObject
+ visible: !!controlMetaObject.exampleComponent
- ListModel {
- id: checkableDelegateModel
- ListElement { label: "Normal" }
- ListElement { label: "Pressed"; press: true }
- ListElement { label: "Checked"; check: true }
- ListElement { label: "CH + PR"; check: true; press: true }
- ListElement { label: "Disabled"; disabled: true }
+ Layout.alignment: Qt.AlignHCenter
+ Layout.topMargin: visible ? 14 : 0
+ Layout.fillWidth: true
+ Layout.preferredHeight: visible ? implicitHeight : 0
}
+ }
+ }
+ }
- RowLayout {
- Frame {
- Column {
- width: 200
-
- Repeater {
- model: checkableDelegateModel
- delegate: CheckDelegate {
- text: label
- width: parent.width
- down: press
- checked: check
- enabled: !disabled
- ButtonGroup.group: radioButtonGroup
- }
- }
- }
- }
-
- ButtonGroup {
- id: radioButtonGroup
- }
-
- Frame {
- Column {
- width: 200
-
- Repeater {
- model: checkableDelegateModel
- delegate: RadioDelegate {
- text: label
- down: press
- width: parent.width
- checked: check
- enabled: !disabled
- ButtonGroup.group: radioButtonGroup
- }
- }
- }
- }
+ RowLayout {
+ id: busyIndicatorRow
+ anchors.centerIn: parent
+ visible: false
- Frame {
- Column {
- width: 200
-
- Repeater {
- model: checkableDelegateModel
- delegate: SwitchDelegate {
- text: label
- width: parent.width
- checked: check
- down: press
- enabled: !disabled
- }
- }
- }
- }
- }
-
- ListModel {
- id: regularDelegateModel
- ListElement { label: "Normal" }
- ListElement { label: "Pressed"; press: true }
- ListElement { label: "Disabled"; disabled: true }
- }
+ BusyIndicator {
+ id: busyIndicator
+ running: visible
+ }
- RowLayout {
- Frame {
- Column {
- width: 200
-
- Repeater {
- model: regularDelegateModel
- delegate: ItemDelegate {
- text: label
- width: parent.width
- down: press
- enabled: !disabled
- }
- }
- }
- }
- Frame {
- Column {
- id: listView
- width: 200
- clip: true
-
- Repeater {
- model: regularDelegateModel
- delegate: SwipeDelegate {
- id: swipeDelegate
- text: label
- width: parent.width
- down: press
- enabled: !disabled
-
- Component {
- id: removeComponent
-
- Rectangle {
- color: swipeDelegate.swipe.complete && swipeDelegate.pressed ? "#333" : "#444"
- width: parent.width
- height: parent.height
- clip: true
-
- Label {
- font.pixelSize: swipeDelegate.font.pixelSize
- text: "Boop"
- color: "white"
- anchors.centerIn: parent
- }
- }
- }
-
- swipe.left: removeComponent
- swipe.right: removeComponent
- }
- }
- }
- }
- }
- }
+ Label {
+ text: qsTr("Fixing assets...")
+ font.pixelSize: Qt.application.font.pixelSize * 2
}
}
+
+ ToolTip {
+ id: infoToolTip
+ x: (parent.width - width) / 2
+ y: parent.height - height - 40
+ parent: window.contentItem
+ }
}