summaryrefslogtreecommitdiffstats
path: root/examples/quick/controls/texteditor
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/controls/texteditor')
-rw-r--r--examples/quick/controls/texteditor/qml/main.qml1
-rw-r--r--examples/quick/controls/texteditor/src/main.cpp24
-rw-r--r--examples/quick/controls/texteditor/texteditor.pro1
3 files changed, 5 insertions, 21 deletions
diff --git a/examples/quick/controls/texteditor/qml/main.qml b/examples/quick/controls/texteditor/qml/main.qml
index 50cbed565..89120094d 100644
--- a/examples/quick/controls/texteditor/qml/main.qml
+++ b/examples/quick/controls/texteditor/qml/main.qml
@@ -46,6 +46,7 @@ import QtQuick.Window 2.1
import org.qtproject.example 1.0
ApplicationWindow {
+ visible: true
width: 640
height: 480
minimumWidth: 400
diff --git a/examples/quick/controls/texteditor/src/main.cpp b/examples/quick/controls/texteditor/src/main.cpp
index a096f70d1..ea7d22de3 100644
--- a/examples/quick/controls/texteditor/src/main.cpp
+++ b/examples/quick/controls/texteditor/src/main.cpp
@@ -38,32 +38,14 @@
**
****************************************************************************/
-#ifdef QT_WIDGETS_LIB
-#include <QtWidgets/QApplication>
-#else
-#include <QtGui/QGuiApplication>
-#endif
-#include <QtQml>
-#include <QtQuick/QQuickView>
-#include <QtCore/QString>
-
+#include "qtquickcontrolsapplication.h"
#include "documenthandler.h"
+#include <QtQml/QQmlApplicationEngine>
int main(int argc, char *argv[])
{
-#ifdef QT_WIDGETS_LIB
- QApplication app(argc, argv);
-#else
- QGuiApplication app(argc, argv);
-#endif
+ QtQuickControlsApplication app(argc, argv);
qmlRegisterType<DocumentHandler>("org.qtproject.example", 1, 0, "DocumentHandler");
QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml"));
- QObject *topLevel = engine.rootObjects().value(0);
- QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
- if ( !window ) {
- qWarning("Error: Your root item has to be a Window.");
- return -1;
- }
- window->show();
return app.exec();
}
diff --git a/examples/quick/controls/texteditor/texteditor.pro b/examples/quick/controls/texteditor/texteditor.pro
index d9b6c8a33..06e669d91 100644
--- a/examples/quick/controls/texteditor/texteditor.pro
+++ b/examples/quick/controls/texteditor/texteditor.pro
@@ -3,6 +3,7 @@ TARGET = texteditor
!android: !ios: !blackberry: qtHaveModule(widgets): QT += widgets
include(src/src.pri)
+include(../shared/shared.pri)
OTHER_FILES += \
qml/main.qml \