Browse Source

Recreate editingFinished signal behaviour without using TextArea::editingFinished

Apparently, editingFinished was only added in Qt 5.6, so we cannot use
it. So we have to manually recreate the behaviour.

Contributes to CURA-342
Arjen Hiemstra 8 years ago
parent
commit
898c621b6f
1 changed files with 17 additions and 2 deletions
  1. 17 2
      resources/qml/Preferences/ReadOnlyTextArea.qml

+ 17 - 2
resources/qml/Preferences/ReadOnlyTextArea.qml

@@ -3,7 +3,6 @@
 
 
 import QtQuick 2.1
 import QtQuick 2.1
 import QtQuick.Controls 1.1
 import QtQuick.Controls 1.1
-import QtQuick.Dialogs 1.2
 
 
 Item
 Item
 {
 {
@@ -28,7 +27,23 @@ Item
 
 
         anchors.fill: parent
         anchors.fill: parent
 
 
-        onEditingFinished: base.editingFinished()
+        Keys.onReturnPressed:
+        {
+            base.editingFinished()
+        }
+
+        Keys.onEnterPressed:
+        {
+            base.editingFinished()
+        }
+
+        onActiveFocusChanged:
+        {
+            if(!activeFocus)
+            {
+                base.editingFinished()
+            }
+        }
     }
     }
 
 
     Label
     Label