diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-03-25 10:11:02 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-25 10:11:02 +0100 |
commit | cc7c4ba902ae6ab3b5eba80d7075ad8d6183a7ec (patch) | |
tree | 3533a1dee0103a35e1881fe2e9c7a73f6f2d95de /examples/quick | |
parent | 76dd99c448ae69cb12a0465facc5dd743b94e624 (diff) | |
parent | ff5d39f0a8f34cdb034df703e7b2a769c945e1ed (diff) | |
download | qtquickcontrols-cc7c4ba902ae6ab3b5eba80d7075ad8d6183a7ec.tar.gz |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'examples/quick')
-rw-r--r-- | examples/quick/controls/calendar/images/eventindicator.png | bin | 0 -> 2914 bytes | |||
-rw-r--r-- | examples/quick/controls/calendar/qml/main.qml | 61 | ||||
-rw-r--r-- | examples/quick/controls/calendar/resources.qrc | 1 | ||||
-rw-r--r-- | examples/quick/controls/touch/content/ButtonPage.qml | 2 | ||||
-rw-r--r-- | examples/quick/dialogs/systemdialogs/CustomDialogs.qml | 28 |
5 files changed, 69 insertions, 23 deletions
diff --git a/examples/quick/controls/calendar/images/eventindicator.png b/examples/quick/controls/calendar/images/eventindicator.png Binary files differnew file mode 100644 index 00000000..1edffd02 --- /dev/null +++ b/examples/quick/controls/calendar/images/eventindicator.png diff --git a/examples/quick/controls/calendar/qml/main.qml b/examples/quick/controls/calendar/qml/main.qml index a42745ed..feb21852 100644 --- a/examples/quick/controls/calendar/qml/main.qml +++ b/examples/quick/controls/calendar/qml/main.qml @@ -46,9 +46,10 @@ import org.qtproject.examples.calendar 1.0 ApplicationWindow { visible: true width: 640 - height: 480 + height: 400 minimumWidth: 400 minimumHeight: 300 + color: "#f4f4f4" title: "Calendar Example" @@ -65,7 +66,7 @@ ApplicationWindow { Rectangle { width: row.width * 0.4 - row.spacing / 2 height: calendar.height - + border.color: Qt.darker(color, 1.2) Column { id: eventsPane anchors.fill: parent @@ -112,19 +113,32 @@ ApplicationWindow { width: eventsListView.width height: eventItemColumn.height + Image { + anchors.top: parent.top + anchors.topMargin: 4 + width: 12 + height: width + source: "qrc:/images/eventindicator.png" + } + + Rectangle { + width: parent.width + height: 1 + color: "#eee" + } + Column { id: eventItemColumn anchors.left: parent.left - anchors.leftMargin: 4 + anchors.leftMargin: 20 anchors.right: parent.right - height: timeLabel.height + nameLabel.height + height: timeLabel.height + nameLabel.height + 8 Label { id: nameLabel width: parent.width wrapMode: Text.Wrap text: modelData.name - font.pointSize: 12 } Label { id: timeLabel @@ -147,14 +161,30 @@ ApplicationWindow { focus: true style: CalendarStyle { - dayDelegate: Rectangle { - color: styleData.date !== undefined && styleData.selected ? selectedDateColor : "white" - readonly property color sameMonthDateTextColor: "black" - readonly property color selectedDateColor: "#aaa" + dayDelegate: Item { + readonly property color sameMonthDateTextColor: "#444" + readonly property color selectedDateColor: Qt.platform.os === "osx" ? "#3778d0" : __syspal.highlight readonly property color selectedDateTextColor: "white" - readonly property color differentMonthDateTextColor: Qt.darker("darkgrey", 1.4) + readonly property color differentMonthDateTextColor: "#bbb" readonly property color invalidDatecolor: "#dddddd" + Rectangle { + anchors.fill: parent + border.color: "transparent" + color: styleData.date !== undefined && styleData.selected ? selectedDateColor : "transparent" + anchors.margins: styleData.selected ? -1 : 0 + } + + Image { + visible: eventModel.eventsForDate(styleData.date).length > 0 + anchors.top: parent.top + anchors.left: parent.left + anchors.margins: -1 + width: 12 + height: width + source: "qrc:/images/eventindicator.png" + } + Label { id: dayDelegateText text: styleData.date.getDate() @@ -172,17 +202,6 @@ ApplicationWindow { color; } } - - Rectangle { - color: styleData.selected ? "white" : "red" - width: 4 - height: width - radius: width / 2 - anchors.horizontalCenter: parent.horizontalCenter - anchors.top: dayDelegateText.bottom - anchors.topMargin: 2 - visible: eventModel.eventsForDate(styleData.date).length > 0 - } } } } diff --git a/examples/quick/controls/calendar/resources.qrc b/examples/quick/controls/calendar/resources.qrc index 69145a82..9da283ba 100644 --- a/examples/quick/controls/calendar/resources.qrc +++ b/examples/quick/controls/calendar/resources.qrc @@ -1,5 +1,6 @@ <RCC> <qresource prefix="/"> <file>qml/main.qml</file> + <file>images/eventindicator.png</file> </qresource> </RCC> diff --git a/examples/quick/controls/touch/content/ButtonPage.qml b/examples/quick/controls/touch/content/ButtonPage.qml index 8cf1dad5..90a8a69c 100644 --- a/examples/quick/controls/touch/content/ButtonPage.qml +++ b/examples/quick/controls/touch/content/ButtonPage.qml @@ -83,7 +83,7 @@ Item { Button { anchors.margins: 20 style: touchStyle - text: "Dont press me" + text: "Don't press me" onClicked: if (stackView) stackView.pop() } diff --git a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml index 2a31147e..389979ef 100644 --- a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 @@ -102,6 +102,7 @@ Item { Layout.alignment: Qt.AlignHCenter SpinBox { id: answer + onEditingFinished: spinboxDialog.click(StandardButton.Ok) } Text { text: "m/s" @@ -111,6 +112,25 @@ Item { } } + Dialog { + id: dateDialog + modality: dialogModal.checked ? Qt.WindowModal : Qt.NonModal + title: customizeTitle.checked ? windowTitleField.text : "Choose a date" + onButtonClicked: console.log("clicked button " + clickedButton) + onAccepted: { + if (clickedButton == StandardButton.Ok) + lastChosen.text = "Accepted " + calendar.selectedDate.toLocaleDateString() + else + lastChosen.text = (clickedButton == StandardButton.Retry ? "(Retry)" : "(Ignore)") + } + + Calendar { + id: calendar + width: parent ? parent.width : implicitWidth + onDoubleClicked: dateDialog.click(StandardButton.Ok) + } + } + Column { anchors.fill: parent anchors.margins: 12 @@ -154,6 +174,7 @@ Item { buttons = StandardButton.Ok helloDialog.standardButtons = buttons spinboxDialog.standardButtons = buttons + dateDialog.standardButtons = buttons updating = false } @@ -257,6 +278,11 @@ Item { anchors.verticalCenter: parent.verticalCenter onClicked: spinboxDialog.open() } + Button { + text: "Date picker" + anchors.verticalCenter: parent.verticalCenter + onClicked: dateDialog.open() + } } } } |