summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-11-12 13:00:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-15 16:34:56 +0100
commit2d8a49a75e2dd691a32a7557f9d07c2ab661f6bf (patch)
tree9bd4b18ef5fbe2c2969f12bdadbe1f7c66cf93ba
parent7cc1656fef21e6bdc044968a79f0a41155357c29 (diff)
downloadqtquickcontrols-2d8a49a75e2dd691a32a7557f9d07c2ab661f6bf.tar.gz
TextEditor example: use the MessageDialog for the About box
Change-Id: I0813b7d392dfe7143d438b4057c5d787d223ad5e Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--examples/quick/controls/texteditor/qml/main.qml36
1 files changed, 6 insertions, 30 deletions
diff --git a/examples/quick/controls/texteditor/qml/main.qml b/examples/quick/controls/texteditor/qml/main.qml
index 14bfa623..50cbed56 100644
--- a/examples/quick/controls/texteditor/qml/main.qml
+++ b/examples/quick/controls/texteditor/qml/main.qml
@@ -38,10 +38,10 @@
**
****************************************************************************/
-import QtQuick 2.1
+import QtQuick 2.2
import QtQuick.Controls 1.1
import QtQuick.Layouts 1.0
-import QtQuick.Dialogs 1.0
+import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1
import org.qtproject.example 1.0
@@ -53,35 +53,11 @@ ApplicationWindow {
title: document.documentTitle + " - Text Editor Example"
- ApplicationWindow {
+ MessageDialog {
id: aboutBox
-
- width: 280
- height: 120
title: "About Text"
-
- ColumnLayout {
- anchors.fill: parent
- anchors.margins: 8
- Item {
- Layout.fillWidth: true
- Layout.fillHeight: true
- Label {
- anchors.centerIn: parent
- horizontalAlignment: Text.AlignHCenter
- text: "This is a basic text editor \nwritten with Qt Quick Controls"
- }
- }
- Button {
- text: "Ok"
- isDefault: true
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.bottom: parent.bottom
- onClicked: aboutBox.close()
- }
- Keys.onReturnPressed: aboutBox.close()
- focus: true
- }
+ text: "This is a basic text editor \nwritten with Qt Quick Controls"
+ icon: StandardIcon.Information
}
Action {
@@ -231,7 +207,7 @@ ApplicationWindow {
}
Menu {
title: "&Help"
- MenuItem { text: "About..." ; onTriggered: aboutBox.show() }
+ MenuItem { text: "About..." ; onTriggered: aboutBox.open() }
}
}