From b6c311a039f520cf9a681708a5d94d2034b4b1a9 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 25 Feb 2014 09:47:11 +0100 Subject: Add input field for decimal numbers Change-Id: Ie0331e7152b992c79708da66d77371558ceaf1cf Reviewed-by: Kalle Viironen --- basicsuite/textinput/main.qml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/textinput/main.qml b/basicsuite/textinput/main.qml index 8f63b83..c6bcda9 100644 --- a/basicsuite/textinput/main.qml +++ b/basicsuite/textinput/main.qml @@ -89,10 +89,10 @@ Flickable { inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText enterKeyText: "Next" enterKeyEnabled: text.length > 0 - onEnterKeyClicked: numberField.focus = true + onEnterKeyClicked: phoneField.focus = true } TextField { - id: numberField + id: phoneField validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ } width: parent.width @@ -100,6 +100,17 @@ Flickable { inputMethodHints: Qt.ImhDialableCharactersOnly enterKeyText: "Next" enterKeyEnabled: text.length > 0 + onEnterKeyClicked: numberField.focus = true + } + TextField { + id: numberField + + validator: RegExpValidator { regExp: /^[0-9\+\-\ .]{6,}$/ } + width: parent.width + previewText: "Decimal number field" + inputMethodHints: Qt.ImhFormattedNumbersOnly + enterKeyText: "Next" + enterKeyEnabled: text.length > 0 onEnterKeyClicked: textArea.focus = true } TextArea { -- cgit v1.2.3 From 07f65e7e1150b5487bbf9a268fe652cebb3b7570 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 25 Feb 2014 10:01:20 +0100 Subject: Merge updates from upstream into keyboard example Change-Id: I0b48f285e63f88788ca6015a1d7a53edaccd35b8 Reviewed-by: Kalle Viironen --- basicsuite/textinput/TextArea.qml | 6 ------ basicsuite/textinput/TextBase.qml | 4 +++- basicsuite/textinput/TextField.qml | 6 ------ basicsuite/textinput/main.qml | 4 ---- 4 files changed, 3 insertions(+), 17 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/textinput/TextArea.qml b/basicsuite/textinput/TextArea.qml index 490e066..6832356 100644 --- a/basicsuite/textinput/TextArea.qml +++ b/basicsuite/textinput/TextArea.qml @@ -77,12 +77,6 @@ TextBase { selectionColor: Qt.rgba(1.0, 1.0, 1.0, 0.5) selectedTextColor: Qt.rgba(0.0, 0.0, 0.0, 0.8) anchors { left: parent.left; right: parent.right; margins: 12 } - cursorDelegate: Rectangle { - width: 2 - opacity: 0.7 - color: "#EEEEEE" - visible: textEdit.activeFocus - } onActiveFocusChanged: if (!activeFocus) deselect() } diff --git a/basicsuite/textinput/TextBase.qml b/basicsuite/textinput/TextBase.qml index 67ee3e3..916b3e2 100644 --- a/basicsuite/textinput/TextBase.qml +++ b/basicsuite/textinput/TextBase.qml @@ -49,7 +49,7 @@ FocusScope { property int fontPixelSize: 32 property string previewText property string enterKeyText - property bool enterKeyEnabled: true + property bool enterKeyEnabled: enterKeyText.length === 0 || editor.text.length > 0 || editor.inputMethodComposing property alias mouseParent: mouseArea.parent implicitHeight: editor.height + 12 @@ -86,6 +86,8 @@ FocusScope { parent: textBase anchors.fill: parent onClicked: { + if (editor.inputMethodComposing) + Qt.inputMethod.commit() var positionInEditor = mapToItem(editor, mouseX, mouseY) var cursorPosition = editor.positionAt(positionInEditor.x, positionInEditor.y) editor.cursorPosition = cursorPosition diff --git a/basicsuite/textinput/TextField.qml b/basicsuite/textinput/TextField.qml index 9b01418..e95ded7 100644 --- a/basicsuite/textinput/TextField.qml +++ b/basicsuite/textinput/TextField.qml @@ -82,12 +82,6 @@ TextBase { selectionColor: Qt.rgba(1.0, 1.0, 1.0, 0.5) selectedTextColor: Qt.rgba(0.0, 0.0, 0.0, 0.8) width: Math.max(flickable.width, implicitWidth)-2 - cursorDelegate: Rectangle { - width: 2 - opacity: 0.7 - color: "#EEEEEE" - visible: textInput.activeFocus - } onActiveFocusChanged: if (!activeFocus) deselect() } } diff --git a/basicsuite/textinput/main.qml b/basicsuite/textinput/main.qml index c6bcda9..2b9caef 100644 --- a/basicsuite/textinput/main.qml +++ b/basicsuite/textinput/main.qml @@ -77,7 +77,6 @@ Flickable { width: parent.width previewText: "One line field" enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: passwordField.focus = true } TextField { @@ -88,7 +87,6 @@ Flickable { previewText: "Password field" inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: phoneField.focus = true } TextField { @@ -99,7 +97,6 @@ Flickable { previewText: "Phone number field" inputMethodHints: Qt.ImhDialableCharactersOnly enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: numberField.focus = true } TextField { @@ -110,7 +107,6 @@ Flickable { previewText: "Decimal number field" inputMethodHints: Qt.ImhFormattedNumbersOnly enterKeyText: "Next" - enterKeyEnabled: text.length > 0 onEnterKeyClicked: textArea.focus = true } TextArea { -- cgit v1.2.3 From ce45d362fc96b01f044170c0f405c8f5ccb64ec5 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 6 Mar 2014 14:33:22 +0100 Subject: Rearrange the order of demos in the launcher The launcher will sort the demos alphabetically based on their titles, and then removes leading digits (see cf9b6d17). This allows us to control the order of the demos. This change sets the following order, from left to right: About Qt Enterprise Embedded Launcher Settings Qt5 Everywhere Qt5 Cinematic Demo Qt5 Launch Presentation Virtual Keyboard Qt Quick Enterprise Controls - Dashboard Qt Quick Enterprise Controls - Gallery Controls: Touch Qt Charts - Gallery Media Player Camera Photo Gallery Graphical Effects Sensors Demo Change-Id: I80e5fb66b55f5b5541acc70410c555d4d971e220 Reviewed-by: Eirik Aavitsland --- basicsuite/about-b2qt/title.txt | 2 +- basicsuite/camera/title.txt | 2 +- basicsuite/controls-touch/title.txt | 2 +- basicsuite/enterprise-charts/title.txt | 2 +- basicsuite/enterprise-dashboard/title.txt | 2 +- basicsuite/enterprise-gallery/title.txt | 2 +- basicsuite/graphicaleffects/title.txt | 2 +- basicsuite/launchersettings/title.txt | 2 +- basicsuite/mediaplayer/title.txt | 2 +- basicsuite/photogallery/title.txt | 2 +- basicsuite/qt5-cinematicdemo/title.txt | 2 +- basicsuite/qt5-everywhere/title.txt | 2 +- basicsuite/qt5-launchpresentation/title.txt | 2 +- basicsuite/qt5-particlesdemo/title.txt | 2 +- basicsuite/sensorexplorer/title.txt | 2 +- basicsuite/sensors/title.txt | 2 +- basicsuite/textinput/title.txt | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/about-b2qt/title.txt b/basicsuite/about-b2qt/title.txt index 634a26a..bc7bf4b 100644 --- a/basicsuite/about-b2qt/title.txt +++ b/basicsuite/about-b2qt/title.txt @@ -1 +1 @@ -About Qt Enterprise Embedded +000. About Qt Enterprise Embedded diff --git a/basicsuite/camera/title.txt b/basicsuite/camera/title.txt index 10a226d..0cf11f5 100644 --- a/basicsuite/camera/title.txt +++ b/basicsuite/camera/title.txt @@ -1 +1 @@ -Camera +110. Camera diff --git a/basicsuite/controls-touch/title.txt b/basicsuite/controls-touch/title.txt index cc2e76a..e35803a 100644 --- a/basicsuite/controls-touch/title.txt +++ b/basicsuite/controls-touch/title.txt @@ -1 +1 @@ -Controls: Touch +080. Controls: Touch diff --git a/basicsuite/enterprise-charts/title.txt b/basicsuite/enterprise-charts/title.txt index d3ce063..2b4d97b 100644 --- a/basicsuite/enterprise-charts/title.txt +++ b/basicsuite/enterprise-charts/title.txt @@ -1 +1 @@ -Qt Charts - Gallery +090. Qt Charts - Gallery diff --git a/basicsuite/enterprise-dashboard/title.txt b/basicsuite/enterprise-dashboard/title.txt index 1a3fb29..443fdd7 100644 --- a/basicsuite/enterprise-dashboard/title.txt +++ b/basicsuite/enterprise-dashboard/title.txt @@ -1 +1 @@ -Qt Quick Enterprise Controls - Dashboard +060. Qt Quick Enterprise Controls - Dashboard diff --git a/basicsuite/enterprise-gallery/title.txt b/basicsuite/enterprise-gallery/title.txt index 4ffcc0f..00ece55 100644 --- a/basicsuite/enterprise-gallery/title.txt +++ b/basicsuite/enterprise-gallery/title.txt @@ -1 +1 @@ -Qt Quick Enterprise Controls - Gallery +070. Qt Quick Enterprise Controls - Gallery diff --git a/basicsuite/graphicaleffects/title.txt b/basicsuite/graphicaleffects/title.txt index e048172..a679fff 100644 --- a/basicsuite/graphicaleffects/title.txt +++ b/basicsuite/graphicaleffects/title.txt @@ -1 +1 @@ -Graphical Effects +130. Graphical Effects diff --git a/basicsuite/launchersettings/title.txt b/basicsuite/launchersettings/title.txt index b2fd1f4..0ec27f6 100644 --- a/basicsuite/launchersettings/title.txt +++ b/basicsuite/launchersettings/title.txt @@ -1 +1 @@ -Launcher Settings +010. Launcher Settings diff --git a/basicsuite/mediaplayer/title.txt b/basicsuite/mediaplayer/title.txt index 7919029..a752761 100644 --- a/basicsuite/mediaplayer/title.txt +++ b/basicsuite/mediaplayer/title.txt @@ -1 +1 @@ -Media Player +100. Media Player diff --git a/basicsuite/photogallery/title.txt b/basicsuite/photogallery/title.txt index 4aee1d3..eda05c5 100644 --- a/basicsuite/photogallery/title.txt +++ b/basicsuite/photogallery/title.txt @@ -1 +1 @@ -Photo Gallery +120. Photo Gallery diff --git a/basicsuite/qt5-cinematicdemo/title.txt b/basicsuite/qt5-cinematicdemo/title.txt index 68451f8..8774828 100644 --- a/basicsuite/qt5-cinematicdemo/title.txt +++ b/basicsuite/qt5-cinematicdemo/title.txt @@ -1 +1 @@ -Qt5 Cinematic Demo +030. Qt5 Cinematic Demo diff --git a/basicsuite/qt5-everywhere/title.txt b/basicsuite/qt5-everywhere/title.txt index 2f1f4ce..2aae9a5 100644 --- a/basicsuite/qt5-everywhere/title.txt +++ b/basicsuite/qt5-everywhere/title.txt @@ -1 +1 @@ -Qt5 Everywhere +020. Qt5 Everywhere diff --git a/basicsuite/qt5-launchpresentation/title.txt b/basicsuite/qt5-launchpresentation/title.txt index d475d8a..19f15b6 100644 --- a/basicsuite/qt5-launchpresentation/title.txt +++ b/basicsuite/qt5-launchpresentation/title.txt @@ -1 +1 @@ -Qt5 Launch Presentation +040. Qt5 Launch Presentation diff --git a/basicsuite/qt5-particlesdemo/title.txt b/basicsuite/qt5-particlesdemo/title.txt index 8abe769..1db7719 100644 --- a/basicsuite/qt5-particlesdemo/title.txt +++ b/basicsuite/qt5-particlesdemo/title.txt @@ -1 +1 @@ -Qt5 Particles Demo +998. Qt5 Particles Demo diff --git a/basicsuite/sensorexplorer/title.txt b/basicsuite/sensorexplorer/title.txt index c56fed8..64de850 100644 --- a/basicsuite/sensorexplorer/title.txt +++ b/basicsuite/sensorexplorer/title.txt @@ -1 +1 @@ -Sensor Explorer +999. Sensor Explorer diff --git a/basicsuite/sensors/title.txt b/basicsuite/sensors/title.txt index 558b7c0..a3a5b97 100644 --- a/basicsuite/sensors/title.txt +++ b/basicsuite/sensors/title.txt @@ -1 +1 @@ -Sensors Demo +140. Sensors Demo diff --git a/basicsuite/textinput/title.txt b/basicsuite/textinput/title.txt index 932c2f3..8e845f4 100644 --- a/basicsuite/textinput/title.txt +++ b/basicsuite/textinput/title.txt @@ -1 +1 @@ -Virtual Keyboard +050. Virtual Keyboard -- cgit v1.2.3 From 818bc14e588f98609dd82f34b47b487a40847890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Thu, 13 Mar 2014 15:58:08 +0200 Subject: Updated preview_l.jpg for textinput demo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTEE-424 Change-Id: I4d23e42d5097386e55666f655b9b6566277ccf4b Reviewed-by: Topi Reiniö --- basicsuite/textinput/preview_l.jpg | Bin 16465 -> 10684 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/textinput/preview_l.jpg b/basicsuite/textinput/preview_l.jpg index f415a86..67a2917 100644 Binary files a/basicsuite/textinput/preview_l.jpg and b/basicsuite/textinput/preview_l.jpg differ -- cgit v1.2.3 From 3872429d4cc8436cf76efe8936de21acc297a5f0 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 27 Mar 2014 08:45:43 +0200 Subject: qt5-everywhere: update working radio playlist List is actually read from qt-project.org, so need to update it there as well. Task-number: QTEE-398 Change-Id: I9dcbda1f3dcb1c6cd8e63434d17289d0e029a1b4 Reviewed-by: Eirik Aavitsland --- basicsuite/qt5-everywhere/demos/radio/channels.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/qt5-everywhere/demos/radio/channels.xml b/basicsuite/qt5-everywhere/demos/radio/channels.xml index 99522ab..0ba2bb7 100644 --- a/basicsuite/qt5-everywhere/demos/radio/channels.xml +++ b/basicsuite/qt5-everywhere/demos/radio/channels.xml @@ -4,10 +4,6 @@ BBC World Service http://vpr.streamguys.net/vpr24.mp3 - - CBC Music Hard Rock - http://2903.live.streamtheworld.com:80/CBC_HAROCK_H_SC.mp3 - "JPR Classics" http://jpr.streamguys.org:80/jpr-classics @@ -22,6 +18,6 @@ Radio Paradise - http://scfire-m26.websys.aol.com:80/radio_paradise_mp3_128kbps.mp3 + http://stream-tx1.radioparadise.com/mp3-128 -- cgit v1.2.3 From e344284df1ba028e83cc6eac5bedf82f3b22a3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Tue, 1 Apr 2014 15:21:28 +0300 Subject: Remove incorrect assingment of QUrl to bool Task-number: QTEE-403 Change-Id: Idd20f43546e133473da54fdad804d23254fd4ba2 Reviewed-by: Rainer Keller --- basicsuite/qt5-everywhere/demos/video/VideoDelegate.qml | 2 -- 1 file changed, 2 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/qt5-everywhere/demos/video/VideoDelegate.qml b/basicsuite/qt5-everywhere/demos/video/VideoDelegate.qml index fedc9f4..9cdbb50 100644 --- a/basicsuite/qt5-everywhere/demos/video/VideoDelegate.qml +++ b/basicsuite/qt5-everywhere/demos/video/VideoDelegate.qml @@ -86,8 +86,6 @@ Item { anchors.bottom: parent.bottom color: "Black" opacity: 0.5 - visible: iconImage.source - } Text { -- cgit v1.2.3 From 9939d72b1e2f67a7af52cc798ae4fd9742d086f6 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Wed, 19 Mar 2014 12:37:19 +0100 Subject: Make sensors demo not rely on measurement errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The former implementation only updates the bubble when notified by a sensor changed event. This is not optimal because when the accelerometer is kept at a constant tilt the value does not change anymore but the bubble has to move further nevertheless. Change-Id: I24793b4c8da3fdc75eb3054acd88976d053149e3 Reviewed-by: Topi Reiniö Reviewed-by: Eirik Aavitsland --- basicsuite/sensors/Accelbubble.qml | 64 +++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 21 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/sensors/Accelbubble.qml b/basicsuite/sensors/Accelbubble.qml index 7fba4d4..c5aeefc 100644 --- a/basicsuite/sensors/Accelbubble.qml +++ b/basicsuite/sensors/Accelbubble.qml @@ -42,6 +42,33 @@ import QtQuick 2.0 import QtSensors 5.0 Item { + function calc() { + if (xAnimation.running || yAnimation.running) + return + + var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * .8) + var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * .8) + + if (newX < 0) + newX = 0 + if (newY < 0) + newY = 0 + + var right = field.width - bubble.width + var bottom = field.height - bubble.height + + if (newX > right) + newX = right + if (newY > bottom) + newY = bottom + + bubble.x = newX + bubble.y = newY + + yBehavior.enabled = true + xBehavior.enabled = true + } + Rectangle { id: field color: "lightblue" @@ -52,26 +79,13 @@ Item { Accelerometer { id: accel active:true - onReadingChanged: { - var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * .1) - var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * .1) - - if (newX < 0) - newX = 0 - if (newY < 0) - newY = 0 - - var right = field.width - bubble.width - var bottom = field.height - bubble.height - - if (newX > right) - newX = right - if (newY > bottom) - newY = bottom + } - bubble.x = newX - bubble.y = newY - } + Timer { + interval: 100 + running: true + repeat: true + onTriggered: calc() } Image { @@ -85,15 +99,23 @@ Item { smooth: true Behavior on y { + id: yBehavior + enabled: false SmoothedAnimation { + id: yAnimation easing.type: Easing.Linear - duration: 100 + duration: 40 + onRunningChanged: calc() } } Behavior on x { + id: xBehavior + enabled: false SmoothedAnimation { + id: xAnimation easing.type: Easing.Linear - duration: 100 + duration: 40 + onRunningChanged: calc() } } } -- cgit v1.2.3 From 8dc84db6555d4fbf131b2191bb8b02bbb56a9a82 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Fri, 28 Mar 2014 13:27:18 +0200 Subject: sensorexplorer: Use identifier field when description is empty Dummy sensors do not have description set, so they show up empty in the sensorexplorer. Use identifier in those cases. Task-number: QTEE-245 Change-Id: Iad160ddccde12124e1c293bb9894870ca4ab7ab9 Reviewed-by: Gatis Paeglis --- basicsuite/sensorexplorer/imports/sensoritem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'basicsuite') diff --git a/basicsuite/sensorexplorer/imports/sensoritem.cpp b/basicsuite/sensorexplorer/imports/sensoritem.cpp index cd33549..2a64d6c 100644 --- a/basicsuite/sensorexplorer/imports/sensoritem.cpp +++ b/basicsuite/sensorexplorer/imports/sensoritem.cpp @@ -101,7 +101,7 @@ void QSensorItem::setStart(bool run) */ QString QSensorItem::id() { - return (_qsensor ? _qsensor->description() : ""); + return (_qsensor ? (!_qsensor->description().isEmpty() ? _qsensor->description() : _qsensor->identifier()) : ""); } /* -- cgit v1.2.3 From eaf6083b8215efce7e57fdb6e2142c7e0407b196 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 20 Mar 2014 12:45:32 +0100 Subject: [launchersettings] Small fixes in wifi settings section - only one list section expanded at a time. - adjust example to the changes in QtWifi API. Change-Id: I08eed885e08f581302f2704e07a0218c95c7454e Reviewed-by: Eirik Aavitsland --- basicsuite/launchersettings/NetworkList.qml | 73 ++++++++++++++++------------- 1 file changed, 40 insertions(+), 33 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/launchersettings/NetworkList.qml b/basicsuite/launchersettings/NetworkList.qml index b733eb6..204e4e2 100644 --- a/basicsuite/launchersettings/NetworkList.qml +++ b/basicsuite/launchersettings/NetworkList.qml @@ -42,9 +42,6 @@ import QtQuick 2.0 import QtQuick.Controls 1.0 import Qt.labs.wifi 0.1 -// ### TODO -// - only 1 delagate open at the time - Item { Component { id: listDelegate @@ -52,17 +49,28 @@ Item { id: delegateBackground property bool expanded: false property bool connected: wifiManager.connectedSSID == network.ssid - property variant networkModel: model - property alias ssidText: ssidLabel.text + property bool actingNetwork: networkView.currentNetworkSsid == network.ssid height: (expanded ? (connected ? 180: 260) : 70) + width: parent.width clip: true // ### fixme color: "#5C5C5C" border.color: "black" border.width: 1 - Behavior on height { NumberAnimation { duration: 500; easing.type: Easing.InOutCubic } } + onExpandedChanged: { + if (expanded) { + if (networkView.hasExpandedDelegate) + networkView.expandedDelegate.expanded = false + networkView.expandedDelegate = this + } else { + networkView.expandedDelegate = 0 + } + } - width: parent.width + Component.onDestruction: if (expanded) networkView.expandedDelegate = 0 + onHeightChanged: if (expanded) networkView.positionViewAtIndex(index, ListView.Contain) + + Behavior on height { NumberAnimation { duration: 500; easing.type: Easing.InOutCubic } } Text { id: ssidLabel @@ -72,7 +80,7 @@ Item { font.pixelSize: 20 font.bold: true color: "#E6E6E6" - text: network.ssid + (connected ? " (connected)" : ""); + text: network.ssid + (actingNetwork ? networkView.networkStateText : ""); } Text { @@ -113,9 +121,7 @@ Item { MouseArea { anchors.fill: parent - onClicked: { - parent.expanded = !expanded - } + onClicked: parent.expanded = !expanded } TextField { @@ -134,15 +140,8 @@ Item { y: passwordInput.visible ? passwordInput.y + passwordInput.height + 20 : passwordInput.y anchors.horizontalCenter: parent.horizontalCenter text: connected ? "Disconnect" : "Connect" - onClicked: { - networkView.currentIndex = index - if (connected) { - wifiManager.disconnect() - } else { - networkView.activeNetwork = networkView.currentItem - wifiManager.connect(network, passwordInput.text); - } - } + onClicked: connected ? wifiManager.disconnect() + : wifiManager.connect(network, passwordInput.text); } } } @@ -153,20 +152,28 @@ Item { model: wifiManager.networks delegate: listDelegate - property variant activeNetwork: "" - property variant networkState: wifiManager.networkState + property string networkStateText: "" + property string currentNetworkSsid: "" + property variant expandedDelegate: 0 + property bool hasExpandedDelegate: expandedDelegate != 0 - onNetworkStateChanged: { - if (activeNetwork) { - var ssid = activeNetwork.networkModel.ssid - var state = "" - if (networkState == WifiManager.ObtainingIPAddress) - state = " (obtaining ip..)" - else if (networkState == WifiManager.DhcpRequestFailed) - state = " (dhcp request failed)" - else if (networkState == WifiManager.Connected) - state = " (connected)" - activeNetwork.ssidText = ssid + state + Connections { + target: wifiManager + onNetworkStateChanged: { + networkView.currentNetworkSsid = network.ssid + var networkStateText = "" + var state = wifiManager.networkState + if (state == WifiManager.ObtainingIPAddress) + networkStateText = " (obtaining ip..)" + else if (state == WifiManager.DhcpRequestFailed) + networkStateText = " (dhcp request failed)" + else if (state == WifiManager.Connected) + networkStateText = " (connected)" + else if (state == WifiManager.Authenticating) + networkStateText = " (authenticating..)" + else if (state == WifiManager.HandshakeFailed) + networkStateText = " (wrong password)" + networkView.networkStateText = networkStateText } } } -- cgit v1.2.3 From 5d498744d0590a0b2d6af68137b344d5415610fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pasi=20Pet=C3=A4j=C3=A4j=C3=A4rvi?= Date: Tue, 8 Apr 2014 14:05:31 +0300 Subject: Change default font for demos to support arabic numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Demos itself did use the wrong font when virtualkeyboard used the correct one. Task-number: QTEE-354 Change-Id: I987b7b6d9c1132c906b6283951bbe46d38237a3d Reviewed-by: Topi Reiniö --- basicsuite/shared/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp index 808d5df..25c3cb4 100644 --- a/basicsuite/shared/main.cpp +++ b/basicsuite/shared/main.cpp @@ -57,10 +57,10 @@ int main(int argc, char **argv) excludeFile.close(); } - QString fontName = QStringLiteral("/system/lib/fonts/OpenSans-Regular.ttf"); + QString fontName = QStringLiteral("/system/lib/fonts/DejaVuSans.ttf"); if (QFile::exists(fontName)) { QFontDatabase::addApplicationFont(fontName); - QFont font("Open Sans"); + QFont font("DejaVu Sans"); font.setPixelSize(12); QGuiApplication::setFont(font); } else { -- cgit v1.2.3 From bb8049fd3dceea482304076b30ef8cbe574e308f Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 9 Apr 2014 14:31:19 +0200 Subject: [about-b2qt] Use Screen element for setting width/height Task-number: QTRD-3032 Change-Id: Ifdd27fe756f120bcb78093626908b04a62065d3a Reviewed-by: Laszlo Agocs --- basicsuite/about-b2qt/main.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/about-b2qt/main.qml b/basicsuite/about-b2qt/main.qml index 5c5c6df..694ba50 100644 --- a/basicsuite/about-b2qt/main.qml +++ b/basicsuite/about-b2qt/main.qml @@ -40,12 +40,13 @@ ****************************************************************************/ import QtQuick 2.0 import QtQuick.Particles 2.0 +import QtQuick.Window 2.1 Item { id: root - width: 1280 - height: 800 + width : Screen.height > Screen.width ? Screen.height : Screen.width + height : Screen.height > Screen.width ? Screen.width : Screen.height // Rectangle { // anchors.fill: parent -- cgit v1.2.3 From 281bb29574c3188a670d125a7e259fc6efcc64e2 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 9 Apr 2014 16:03:08 +0200 Subject: [launchersettings] Fix UI scaling Task-number: QTEE-473 Change-Id: I8fb07fd007c394beec1603cdf171e0af15af0819 Reviewed-by: Laszlo Agocs --- basicsuite/launchersettings/main.qml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/launchersettings/main.qml b/basicsuite/launchersettings/main.qml index 718bf69..dbd1a31 100644 --- a/basicsuite/launchersettings/main.qml +++ b/basicsuite/launchersettings/main.qml @@ -44,6 +44,7 @@ import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Private 1.0 +import QtQuick.Window 2.1 Rectangle { id: root @@ -73,7 +74,7 @@ Rectangle { text: control.text anchors.centerIn: parent color: "white" - font.pixelSize: 23 + font.pixelSize: 22 renderType: Text.NativeRendering } } @@ -140,7 +141,8 @@ Rectangle { ColumnLayout { id: mainLayout - width: 800 + // can not use size of "root" here, it will shrink UI when virtual keyboard is open + width: Math.min(Screen.width, Screen.height) height: implicitHeight anchors.left: parent.left anchors.right: parent.right @@ -247,6 +249,7 @@ Rectangle { id: hostnameButton style: buttonStyle text: "Change hostname" + implicitWidth: 260 onClicked: networkControllerLoader.item.setHostname(hostname.text); enabled: networkControllerLoader.item != undefined } -- cgit v1.2.3 From f82822d73ed03b5e971a940bcf9e13d11128b1a9 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Thu, 10 Apr 2014 09:17:11 +0200 Subject: Revert "Add input field for decimal numbers" This reverts commit b6c311a039f520cf9a681708a5d94d2034b4b1a9. Numeric input does not work due to QTRD-2945. Task-number: QTEE-485 Change-Id: Ie7ab6860dbaf65b6105e7dbd722a557b15c3e08b Reviewed-by: Kalle Viironen --- basicsuite/textinput/main.qml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/textinput/main.qml b/basicsuite/textinput/main.qml index 2b9caef..70455bf 100644 --- a/basicsuite/textinput/main.qml +++ b/basicsuite/textinput/main.qml @@ -87,26 +87,16 @@ Flickable { previewText: "Password field" inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText enterKeyText: "Next" - onEnterKeyClicked: phoneField.focus = true + onEnterKeyClicked: numberField.focus = true } TextField { - id: phoneField + id: numberField validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ } width: parent.width previewText: "Phone number field" inputMethodHints: Qt.ImhDialableCharactersOnly enterKeyText: "Next" - onEnterKeyClicked: numberField.focus = true - } - TextField { - id: numberField - - validator: RegExpValidator { regExp: /^[0-9\+\-\ .]{6,}$/ } - width: parent.width - previewText: "Decimal number field" - inputMethodHints: Qt.ImhFormattedNumbersOnly - enterKeyText: "Next" onEnterKeyClicked: textArea.focus = true } TextArea { -- cgit v1.2.3 From a7353367b7d29eacc70ea960409e8eb682fe4e9c Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 10 Apr 2014 15:18:26 +0200 Subject: Update enterprise controls demos to version 1.1 Task-number: QTEE-482 Change-Id: I79f665de133cbe1c77962a8d93acdddd2e05fcc1 Reviewed-by: Samuli Piippo --- .../enterprise-dashboard/DashboardGaugeStyle.qml | 2 +- basicsuite/enterprise-dashboard/IconGaugeStyle.qml | 2 +- .../enterprise-dashboard/TachometerStyle.qml | 2 +- basicsuite/enterprise-dashboard/TurnIndicator.qml | 2 +- .../enterprise-dashboard/fonts/DejaVuSans.ttf | Bin 0 -> 720856 bytes basicsuite/enterprise-dashboard/main.qml | 4 +- .../enterprise-gallery/CircularGaugeDarkStyle.qml | 2 +- .../CircularGaugeDefaultStyle.qml | 2 +- .../enterprise-gallery/CircularGaugeLightStyle.qml | 2 +- .../enterprise-gallery/CircularGaugeView.qml | 12 +- basicsuite/enterprise-gallery/ControlLabel.qml | 28 ++++ .../enterprise-gallery/ControlViewToolbar.qml | 1 - .../enterprise-gallery/CustomizerCheckBox.qml | 45 ------ basicsuite/enterprise-gallery/CustomizerLabel.qml | 2 +- basicsuite/enterprise-gallery/CustomizerSwitch.qml | 26 +++ .../enterprise-gallery/PieMenuControlView.qml | 31 +--- basicsuite/enterprise-gallery/PieMenuDarkStyle.qml | 2 +- .../enterprise-gallery/PieMenuDefaultStyle.qml | 2 +- basicsuite/enterprise-gallery/StylePicker.qml | 4 +- basicsuite/enterprise-gallery/main.qml | 178 ++++++++++++++++----- basicsuite/enterprise-gallery/preview_l.jpg | Bin 9016 -> 9525 bytes 21 files changed, 216 insertions(+), 133 deletions(-) create mode 100644 basicsuite/enterprise-dashboard/fonts/DejaVuSans.ttf create mode 100644 basicsuite/enterprise-gallery/ControlLabel.qml delete mode 100644 basicsuite/enterprise-gallery/CustomizerCheckBox.qml create mode 100644 basicsuite/enterprise-gallery/CustomizerSwitch.qml (limited to 'basicsuite') diff --git a/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml b/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml index 7958fca..632b63b 100644 --- a/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml +++ b/basicsuite/enterprise-dashboard/DashboardGaugeStyle.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 CircularGaugeStyle { tickmarkInset: toPixels(0.04) diff --git a/basicsuite/enterprise-dashboard/IconGaugeStyle.qml b/basicsuite/enterprise-dashboard/IconGaugeStyle.qml index 0b24351..a04d0e9 100644 --- a/basicsuite/enterprise-dashboard/IconGaugeStyle.qml +++ b/basicsuite/enterprise-dashboard/IconGaugeStyle.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 DashboardGaugeStyle { id: fuelGaugeStyle diff --git a/basicsuite/enterprise-dashboard/TachometerStyle.qml b/basicsuite/enterprise-dashboard/TachometerStyle.qml index c4649da..15a2601 100644 --- a/basicsuite/enterprise-dashboard/TachometerStyle.qml +++ b/basicsuite/enterprise-dashboard/TachometerStyle.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 DashboardGaugeStyle { id: tachometerStyle diff --git a/basicsuite/enterprise-dashboard/TurnIndicator.qml b/basicsuite/enterprise-dashboard/TurnIndicator.qml index 9dd7d5f..22d0ea9 100644 --- a/basicsuite/enterprise-dashboard/TurnIndicator.qml +++ b/basicsuite/enterprise-dashboard/TurnIndicator.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 Item { // This enum is actually keyboard-related, but it serves its purpose diff --git a/basicsuite/enterprise-dashboard/fonts/DejaVuSans.ttf b/basicsuite/enterprise-dashboard/fonts/DejaVuSans.ttf new file mode 100644 index 0000000..19ed0b4 Binary files /dev/null and b/basicsuite/enterprise-dashboard/fonts/DejaVuSans.ttf differ diff --git a/basicsuite/enterprise-dashboard/main.qml b/basicsuite/enterprise-dashboard/main.qml index da5f296..7f8ee75 100644 --- a/basicsuite/enterprise-dashboard/main.qml +++ b/basicsuite/enterprise-dashboard/main.qml @@ -22,8 +22,8 @@ import QtQuick 2.0 import QtQuick.Window 2.1 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 -import QtQuick.Enterprise.Controls 1.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls 1.1 +import QtQuick.Enterprise.Controls.Styles 1.1 Rectangle { id: root diff --git a/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml b/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml index fb85f86..0de1180 100644 --- a/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml +++ b/basicsuite/enterprise-gallery/CircularGaugeDarkStyle.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 CircularGaugeStyle { id: root diff --git a/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml b/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml index 7aec7b6..23b25c4 100644 --- a/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml +++ b/basicsuite/enterprise-gallery/CircularGaugeDefaultStyle.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 CircularGaugeStyle { labelStepSize: 20 diff --git a/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml b/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml index 7d00c1f..87afa7d 100644 --- a/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml +++ b/basicsuite/enterprise-gallery/CircularGaugeLightStyle.qml @@ -19,7 +19,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 CircularGaugeStyle { id: root diff --git a/basicsuite/enterprise-gallery/CircularGaugeView.qml b/basicsuite/enterprise-gallery/CircularGaugeView.qml index 92ee6c5..a24b980 100644 --- a/basicsuite/enterprise-gallery/CircularGaugeView.qml +++ b/basicsuite/enterprise-gallery/CircularGaugeView.qml @@ -20,7 +20,7 @@ import QtQuick 2.0 import QtQuick.Controls 1.0 -import QtQuick.Enterprise.Controls 1.0 +import QtQuick.Enterprise.Controls 1.1 ControlView { id: controlView @@ -66,8 +66,8 @@ ControlView { id: gauge minimumValue: customizerItem.minimumValue maximumValue: customizerItem.maximumValue - width: root.toPixels(0.65) - height: width + width: controlBounds.width + height: controlBounds.height value: accelerating ? maximumValue : 0 style: styleMap[customizerItem.currentStylePath] @@ -174,7 +174,7 @@ ControlView { minimumValue: 0 value: 0 maximumValue: 360 - stepSize: labelStepSizeSlider.stepSize + stepSize: 1 } CustomizerLabel { @@ -184,9 +184,9 @@ ControlView { CustomizerSlider { id: maximumValueSlider minimumValue: 0 - value: 220 + value: 240 maximumValue: 300 - stepSize: labelStepSizeSlider.stepSize + stepSize: 1 } CustomizerLabel { diff --git a/basicsuite/enterprise-gallery/ControlLabel.qml b/basicsuite/enterprise-gallery/ControlLabel.qml new file mode 100644 index 0000000..0335342 --- /dev/null +++ b/basicsuite/enterprise-gallery/ControlLabel.qml @@ -0,0 +1,28 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtQuick Enterprise Controls Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Text { + font.pixelSize: Math.min(32, root.toPixels(0.045)) + color: "#4e4e4e" + styleColor: "#ffffff" + style: Text.Raised +} diff --git a/basicsuite/enterprise-gallery/ControlViewToolbar.qml b/basicsuite/enterprise-gallery/ControlViewToolbar.qml index 5aac041..f3dd07b 100644 --- a/basicsuite/enterprise-gallery/ControlViewToolbar.qml +++ b/basicsuite/enterprise-gallery/ControlViewToolbar.qml @@ -76,7 +76,6 @@ BlackButtonBackground { Image { source: "images/icon-settings.png" anchors.centerIn: parent - scale: -1 } } } diff --git a/basicsuite/enterprise-gallery/CustomizerCheckBox.qml b/basicsuite/enterprise-gallery/CustomizerCheckBox.qml deleted file mode 100644 index 542e09a..0000000 --- a/basicsuite/enterprise-gallery/CustomizerCheckBox.qml +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc -** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com -** -** This file is part of the QtQuick Enterprise Controls Add-on. -** -** $QT_BEGIN_LICENSE$ -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. -** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Styles 1.0 - -CheckBox { - id: checkBox - anchors.horizontalCenter: parent.horizontalCenter - width: root.width * 0.04 - height: width - - style: CheckBoxStyle { - indicator: Rectangle { - color: "#666" - height: control.height - width: height - - Rectangle { - anchors.fill: parent - anchors.margins: Math.round(checkBox.width * 0.1) - color: "#111" - visible: control.checked - } - } - } -} diff --git a/basicsuite/enterprise-gallery/CustomizerLabel.qml b/basicsuite/enterprise-gallery/CustomizerLabel.qml index c4cb69c..c85807c 100644 --- a/basicsuite/enterprise-gallery/CustomizerLabel.qml +++ b/basicsuite/enterprise-gallery/CustomizerLabel.qml @@ -21,7 +21,7 @@ import QtQuick 2.0 Text { - color: fontColor + color: darkBackground ? root.darkFontColor : root.lightFontColor font.pixelSize: root.toPixels(0.04) font.family: openSans.name anchors.horizontalCenter: parent.horizontalCenter diff --git a/basicsuite/enterprise-gallery/CustomizerSwitch.qml b/basicsuite/enterprise-gallery/CustomizerSwitch.qml new file mode 100644 index 0000000..3048aae --- /dev/null +++ b/basicsuite/enterprise-gallery/CustomizerSwitch.qml @@ -0,0 +1,26 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtQuick Enterprise Controls Add-on. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.Controls 1.1 + +Switch { + anchors.horizontalCenter: parent.horizontalCenter +} diff --git a/basicsuite/enterprise-gallery/PieMenuControlView.qml b/basicsuite/enterprise-gallery/PieMenuControlView.qml index cba341b..2c06176 100644 --- a/basicsuite/enterprise-gallery/PieMenuControlView.qml +++ b/basicsuite/enterprise-gallery/PieMenuControlView.qml @@ -21,7 +21,7 @@ import QtQuick 2.0 import QtGraphicalEffects 1.0 import QtQuick.Controls 1.0 -import QtQuick.Enterprise.Controls 1.0 +import QtQuick.Enterprise.Controls 1.1 Rectangle { id: view @@ -94,34 +94,7 @@ Rectangle { anchors.fill: parent onClicked: { - pieMenu.popup(touchArea.mouseX, touchArea.mouseY) - } - } - - Item { - width: labelText.width - height: labelText.height - anchors.bottom: pieMenu.top - anchors.bottomMargin: 10 - anchors.horizontalCenter: pieMenu.horizontalCenter - visible: pieMenu.visible - - Item { - id: labelBlurGuard - anchors.centerIn: parent - width: labelText.implicitWidth * 2 - height: labelText.implicitHeight * 2 - - Text { - id: labelText - font.pointSize: 20 - text: pieMenu.currentIndex !== -1 ? pieMenu.menuItems[pieMenu.currentIndex].text : "" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - anchors.centerIn: parent - color: "#ccc" - antialiasing: true - } + pieMenu.popup(touchArea.mouseX, touchArea.mouseY); } } diff --git a/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml b/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml index 354775d..ab03701 100644 --- a/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml +++ b/basicsuite/enterprise-gallery/PieMenuDarkStyle.qml @@ -18,7 +18,7 @@ ** ****************************************************************************/ -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 PieMenuStyle { backgroundColor: "#222" diff --git a/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml b/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml index 1ad8480..4b0edb1 100644 --- a/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml +++ b/basicsuite/enterprise-gallery/PieMenuDefaultStyle.qml @@ -18,7 +18,7 @@ ** ****************************************************************************/ -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls.Styles 1.1 PieMenuStyle { } diff --git a/basicsuite/enterprise-gallery/StylePicker.qml b/basicsuite/enterprise-gallery/StylePicker.qml index 48c1298..f4e097e 100644 --- a/basicsuite/enterprise-gallery/StylePicker.qml +++ b/basicsuite/enterprise-gallery/StylePicker.qml @@ -21,8 +21,8 @@ import QtQuick 2.0 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 -import QtQuick.Enterprise.Controls 1.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls 1.1 +import QtQuick.Enterprise.Controls.Styles 1.1 ListView { id: stylePicker diff --git a/basicsuite/enterprise-gallery/main.qml b/basicsuite/enterprise-gallery/main.qml index f1f2e17..de60f47 100644 --- a/basicsuite/enterprise-gallery/main.qml +++ b/basicsuite/enterprise-gallery/main.qml @@ -24,12 +24,14 @@ import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Private 1.0 import QtQuick.Dialogs 1.0 -import QtQuick.Enterprise.Controls 1.0 -import QtQuick.Enterprise.Controls.Styles 1.0 +import QtQuick.Enterprise.Controls 1.1 +import QtQuick.Enterprise.Controls.Styles 1.1 +import QtQuick.Layouts 1.0 import QtQuick.Window 2.1 Rectangle { id: root + objectName: "window" visible: true width: 480 height: 800 @@ -42,8 +44,9 @@ Rectangle { } property bool isScreenPortrait: height > width - property color fontColor: "white" - readonly property color lightBackgroundColor: "#ccc" + property color lightFontColor: "#222" + property color darkFontColor: "#e7e7e7" + readonly property color lightBackgroundColor: "#cccccc" readonly property color darkBackgroundColor: "#161616" property real customizerPropertySpacing: 10 property real colorPickerRowSpacing: 8 @@ -53,34 +56,69 @@ Rectangle { property Component dial: ControlView { darkBackground: false - control: Dial { - id: dial - width: root.toPixels(0.3) - height: width + control: Column { + id: dialColumn + width: controlBounds.width + height: controlBounds.height - spacing + spacing: root.toPixels(0.05) + + Column { + id: volumeColumn + width: parent.width + height: (dialColumn.height - dialColumn.spacing) / 2 + spacing: height * 0.025 + + Dial { + id: volumeDial + width: parent.width + height: volumeColumn.height - volumeText.height - volumeColumn.spacing + + /*! + Determines whether the dial animates its rotation to the new value when + a single click or touch is received on the dial. + */ + property bool animate: customizerItem.animate + + Behavior on value { + enabled: volumeDial.animate && !volumeDial.pressed + NumberAnimation { + duration: 300 + easing.type: Easing.OutSine + } + } + } - /*! - Determines whether the dial animates its rotation to the new value when - a single click or touch is received on the dial. - */ - property bool animate: customizerItem.animate - - Behavior on value { - enabled: dial.animate && !dial.pressed - NumberAnimation { - duration: 300 - easing.type: Easing.OutSine + ControlLabel { + id: volumeText + text: "Volume" + anchors.horizontalCenter: parent.horizontalCenter } } - Text { - text: "Volume" - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: dial.bottom - anchors.topMargin: 10 - font.pixelSize: root.toPixels(0.045) - color: "#4e4e4e" - styleColor: "#ffffff" - style: Text.Raised + Column { + id: trebleColumn + width: parent.width + height: (dialColumn.height - dialColumn.spacing) / 2 + spacing: height * 0.025 + + Dial { + id: dial2 + width: parent.width + height: trebleColumn.height - trebleText.height - trebleColumn.spacing + + stepSize: 1 + maximumValue: 10 + + style: DialStyle { + labelInset: outerRadius * 0 + } + } + + ControlLabel { + id: trebleText + text: "Treble" + anchors.horizontalCenter: parent.horizontalCenter + } } } @@ -91,10 +129,9 @@ Rectangle { CustomizerLabel { text: "Animate" - color: "black" } - CustomizerCheckBox { + CustomizerSwitch { id: animateCheckBox } } @@ -115,8 +152,8 @@ Rectangle { id: gaugeView control: Gauge { id: gauge - width: orientation === Qt.Vertical ? root.toPixels(0.15) : gaugeView.controlBounds.width * 0.65 - height: orientation === Qt.Vertical ? root.toPixels(0.65) : gaugeView.controlBounds.height * 0.15 + width: orientation === Qt.Vertical ? gaugeView.controlBounds.height * 0.3 : gaugeView.controlBounds.width + height: orientation === Qt.Vertical ? gaugeView.controlBounds.height : gaugeView.controlBounds.height * 0.3 anchors.centerIn: parent minimumValue: 0 @@ -150,7 +187,7 @@ Rectangle { text: "Vertical orientation" } - CustomizerCheckBox { + CustomizerSwitch { id: orientationCheckBox checked: true } @@ -159,7 +196,7 @@ Rectangle { text: controlItem.orientation === Qt.Vertical ? "Left align" : "Top align" } - CustomizerCheckBox { + CustomizerSwitch { id: alignCheckBox checked: true } @@ -179,6 +216,67 @@ Rectangle { property Component pieMenu: PieMenuControlView {} + property Component statusIndicator: ControlView { + id: statusIndicatorView + darkBackground: false + + Timer { + id: recordingFlashTimer + running: true + repeat: true + interval: 1000 + } + + ColumnLayout { + id: indicatorLayout + width: statusIndicatorView.controlBounds.width * 0.25 + height: statusIndicatorView.controlBounds.height * 0.75 + anchors.centerIn: parent + + Repeater { + model: ListModel { + id: indicatorModel + ListElement { + name: "Power" + indicatorColor: "green" + } + ListElement { + name: "Recording" + indicatorColor: "red" + } + } + + ColumnLayout { + Layout.preferredWidth: indicatorLayout.width +// Layout.preferredHeight: indicatorLayout.height * 0.25 + spacing: 0 + + StatusIndicator { + id: indicator + color: indicatorColor + Layout.preferredWidth: statusIndicatorView.controlBounds.width * 0.07 + Layout.preferredHeight: Layout.preferredWidth + Layout.alignment: Qt.AlignHCenter + on: true + + Connections { + target: recordingFlashTimer + onTriggered: if (name == "Recording") indicator.on = !indicator.on + } + } + ControlLabel { + id: indicatorLabel + text: name +// elide: Text.ElideRight + Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: parent.width + horizontalAlignment: Text.AlignHCenter + } + } + } + } + } + FontLoader { id: openSans Component.onCompleted: { @@ -196,6 +294,7 @@ Rectangle { "Dial": dial, "Gauge": gauge, "PieMenu": pieMenu, + "StatusIndicator": statusIndicator, "ToggleButton": toggleButton } @@ -217,9 +316,12 @@ Rectangle { ListElement { title: "Gauge" } - //ListElement { - // title: "PieMenu" - //} +// ListElement { +// title: "PieMenu" +// } + ListElement { + title: "StatusIndicator" + } ListElement { title: "ToggleButton" } @@ -238,7 +340,7 @@ Rectangle { } style: BlackButtonStyle { - fontColor: root.fontColor + fontColor: root.darkFontColor } onClicked: { diff --git a/basicsuite/enterprise-gallery/preview_l.jpg b/basicsuite/enterprise-gallery/preview_l.jpg index 8ddcad8..644bac5 100644 Binary files a/basicsuite/enterprise-gallery/preview_l.jpg and b/basicsuite/enterprise-gallery/preview_l.jpg differ -- cgit v1.2.3 From 89ce36fca455bf2babf3eae772ca21ce140cf16d Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 11 Apr 2014 14:20:48 +0200 Subject: Fix PieMenu not showing in enterprise-gallery launcher demo. The problem is that the root item doesn't get the correct size - or any size for that matter - so it is never visible. The fix for this is already in Qt 5.3 (see QTBUG-36938), but we can still work around it for earlier versions with this fix. Task-number: QTRD-3040 Change-Id: I38a5f793cf1cc07a758d9118c31bc3177a75da54 Reviewed-by: Samuli Piippo Reviewed-by: Kalle Viironen Reviewed-by: Gatis Paeglis --- basicsuite/shared/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'basicsuite') diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp index 25c3cb4..d33b09c 100644 --- a/basicsuite/shared/main.cpp +++ b/basicsuite/shared/main.cpp @@ -25,6 +25,9 @@ #include #include +#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) +#include +#endif #include #include @@ -70,6 +73,11 @@ int main(int argc, char **argv) } QQuickView view; +#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) + // Ensure the width and height are valid because of QTBUG-36938. + QObject::connect(&view, SIGNAL(widthChanged(int)), view.contentItem(), SLOT(setWidth(int))); + QObject::connect(&view, SIGNAL(heightChanged(int)), view.contentItem(), SLOT(setHeight(int))); +#endif DummyEngine engine; view.rootContext()->setContextProperty("engine", &engine); -- cgit v1.2.3 From 846728c8a3f7681dc56d52bb3859a82130c84cc8 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Fri, 11 Apr 2014 14:58:05 +0200 Subject: Show PieMenu in enterprise controls list view. Change-Id: I022ef68df7a5e5635717679e3cf7447b75a62d9a Reviewed-by: Samuli Piippo --- basicsuite/enterprise-gallery/main.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/enterprise-gallery/main.qml b/basicsuite/enterprise-gallery/main.qml index de60f47..373c4f1 100644 --- a/basicsuite/enterprise-gallery/main.qml +++ b/basicsuite/enterprise-gallery/main.qml @@ -316,9 +316,9 @@ Rectangle { ListElement { title: "Gauge" } -// ListElement { -// title: "PieMenu" -// } + ListElement { + title: "PieMenu" + } ListElement { title: "StatusIndicator" } -- cgit v1.2.3 From 63d998641077d9074281f402ae7becb41c037a2c Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Mon, 14 Apr 2014 15:26:59 +0200 Subject: Revert "Show PieMenu in enterprise controls list view." The PieMenu does not handle screen rotation properly. Thus it will be removed from the demo right now. This reverts commit 846728c8a3f7681dc56d52bb3859a82130c84cc8. Change-Id: Ie8e7f30761a6da403b7ad4de16d4594c95c16163 Reviewed-by: Kalle Viironen --- basicsuite/enterprise-gallery/main.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'basicsuite') diff --git a/basicsuite/enterprise-gallery/main.qml b/basicsuite/enterprise-gallery/main.qml index 373c4f1..de60f47 100644 --- a/basicsuite/enterprise-gallery/main.qml +++ b/basicsuite/enterprise-gallery/main.qml @@ -316,9 +316,9 @@ Rectangle { ListElement { title: "Gauge" } - ListElement { - title: "PieMenu" - } +// ListElement { +// title: "PieMenu" +// } ListElement { title: "StatusIndicator" } -- cgit v1.2.3