Use some slots of TextEditor now that we support them
authorTobias Koenig <tobias.koenig@kdab.com>
Wed, 17 Oct 2012 17:29:41 +0000 (19:29 +0200)
committerTobias Koenig <tobias.koenig@kdab.com>
Wed, 17 Oct 2012 17:30:02 +0000 (19:30 +0200)
editor.qml

index 87aab50..6e9f5e0 100644 (file)
@@ -1,13 +1,26 @@
 import QtGui 1.0
 
 MainWindow {
+  windowTitle: qsTr("Declarative Widget Editor")
+
+  size: Qt.size(500, 300)
 
   MenuBar {
     Menu {
       title: qsTr("File")
 
       Action {
-        text: "New"
+        text: qsTr("New")
+      }
+
+      Action {
+        text: qsTr("Save")
+      }
+
+      Separator {}
+
+      Action {
+        text: qsTr("Print")
       }
 
       Separator {}
@@ -22,29 +35,63 @@ MainWindow {
       title: qsTr("Edit")
 
       Action {
-        text: "Copy"
+        text: qsTr("Undo")
+        onTriggered: textEdit.undo()
+      }
 
-        onTriggered: textEdit.copy()
+      Action {
+        text: qsTr("Redo")
+        onTriggered: textEdit.redo()
+      }
+
+      Separator {}
+
+      Action {
+        text: qsTr("Cut")
+        onTriggered: textEdit.cut()
       }
 
       Action {
-        text: "Paste"
+        text: qsTr("Copy")
+        onTriggered: textEdit.copy()
+      }
 
+      Action {
+        text: qsTr("Paste")
         onTriggered: textEdit.paste()
       }
+
+      Separator {}
+
+      Action {
+        text: qsTr("Select All")
+        onTriggered: textEdit.selectAll()
+      }
     }
 
-    Separator {}
+    Menu {
+      title: qsTr("View")
+
+      Action {
+        text: qsTr("Enlarge Font")
+        onTriggered: textEdit.zoomIn()
+      }
+
+      Action {
+        text: qsTr("Shrink Font")
+        onTriggered: textEdit.zoomOut()
+      }
+    }
 
     Menu {
       title: qsTr("Help")
 
       Action {
-        text: "About"
+        text: qsTr("About")
       }
 
       Action {
-        text: "About Qt"
+        text: qsTr("About Qt")
       }
     }
   }