From 1070aeb5521a95039cad3f4536e85e99526a4900 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 27 Nov 2013 17:38:12 +0100 Subject: Revise main() in examples Replace the inconvenient QT_QUICK_CONTROLS_EXAMPLE_MAIN macro with a simpler macro that merely defines the actual application type. This way it's easier to do tweaks to main() when for example testing a different application font size. Moreover, browsing the example code becomes more convenient (especially online). Task-number: QTBUG-35083 Change-Id: I8203816a9112bf29b4661baa86bf4a196554db05 Reviewed-by: Jens Bache-Wiig --- examples/quick/controls/gallery/gallery.pro | 1 + examples/quick/controls/gallery/main.qml | 1 + examples/quick/controls/gallery/src/main.cpp | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'examples/quick/controls/gallery') diff --git a/examples/quick/controls/gallery/gallery.pro b/examples/quick/controls/gallery/gallery.pro index 09358658..68ed0c16 100644 --- a/examples/quick/controls/gallery/gallery.pro +++ b/examples/quick/controls/gallery/gallery.pro @@ -3,6 +3,7 @@ TARGET = gallery !android: !ios: !blackberry: qtHaveModule(widgets): QT += widgets include(src/src.pri) +include(../shared/shared.pri) OTHER_FILES += \ main.qml \ diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index 43b6776e..61e77ef8 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -49,6 +49,7 @@ import QtQuick.Dialogs 1.0 import "content" ApplicationWindow { + visible: true title: "Component Gallery" width: 640 diff --git a/examples/quick/controls/gallery/src/main.cpp b/examples/quick/controls/gallery/src/main.cpp index 57ba57e3..a757f485 100644 --- a/examples/quick/controls/gallery/src/main.cpp +++ b/examples/quick/controls/gallery/src/main.cpp @@ -38,5 +38,12 @@ ** ****************************************************************************/ -#include "../../shared/qt_quick_controls_examplemain.h" -QT_QUICK_CONTROLS_EXAMPLE_MAIN(qrc:/main.qml) +#include "qtquickcontrolsapplication.h" +#include + +int main(int argc, char *argv[]) +{ + QtQuickControlsApplication app(argc, argv); + QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); + return app.exec(); +} -- cgit v1.2.1