aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/texteditor
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quickcontrols2/texteditor')
-rw-r--r--examples/quickcontrols2/texteditor/qml/+touch/texteditor.qml17
-rw-r--r--examples/quickcontrols2/texteditor/texteditor.cpp11
2 files changed, 10 insertions, 18 deletions
diff --git a/examples/quickcontrols2/texteditor/qml/+touch/texteditor.qml b/examples/quickcontrols2/texteditor/qml/+touch/texteditor.qml
index a7f176a9..11d153f5 100644
--- a/examples/quickcontrols2/texteditor/qml/+touch/texteditor.qml
+++ b/examples/quickcontrols2/texteditor/qml/+touch/texteditor.qml
@@ -38,7 +38,6 @@
**
****************************************************************************/
-import QtGraphicalEffects 1.0
import QtQuick 2.8
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1
@@ -226,7 +225,7 @@ ApplicationWindow {
}
}
- Button {
+ RoundButton {
id: editButton
font.family: "fontello"
text: "\uE809" // icon-pencil
@@ -245,20 +244,6 @@ ApplicationWindow {
// Force focus on the text area so the cursor and footer show up.
textArea.forceActiveFocus()
}
-
- background: Rectangle {
- implicitWidth: parent.width
- implicitHeight: parent.height
- radius: width / 2
- color: parent.down ? Qt.darker(Material.accent) : Material.accent
-
- layer.enabled: editButton.enabled
- layer.effect: DropShadow {
- color: "#44000000"
- verticalOffset: 2
- samples: 16
- }
- }
}
Dialog {
diff --git a/examples/quickcontrols2/texteditor/texteditor.cpp b/examples/quickcontrols2/texteditor/texteditor.cpp
index 7fda4fa9..10ba675c 100644
--- a/examples/quickcontrols2/texteditor/texteditor.cpp
+++ b/examples/quickcontrols2/texteditor/texteditor.cpp
@@ -70,10 +70,17 @@ int main(int argc, char *argv[])
qmlRegisterType<DocumentHandler>("io.qt.examples.texteditor", 1, 0, "DocumentHandler");
- QQmlApplicationEngine engine;
+ QStringList selectors;
#ifdef QT_EXTRA_FILE_SELECTOR
- QQmlFileSelector::get(&engine)->setExtraSelectors(QStringList() << QT_EXTRA_FILE_SELECTOR);
+ selectors += QT_EXTRA_FILE_SELECTOR;
+#else
+ if (app.arguments().contains("-touch"))
+ selectors += "touch";
#endif
+
+ QQmlApplicationEngine engine;
+ QQmlFileSelector::get(&engine)->setExtraSelectors(selectors);
+
engine.load(QUrl("qrc:/qml/texteditor.qml"));
if (engine.rootObjects().isEmpty())
return -1;