Without the shared boilerplate code, the demo will not run unless the
application is launched from the directory containing the QML files. Also, it
improves consistency to use the same code as with the other examples.
Change-Id: Ic3bc358c13cdee4310aaaf7daf4c645c4709027e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
** $QT_END_LICENSE$
**
****************************************************************************/
-
-#include <QGuiApplication>
-#include <QStringList>
-#include <QQuickView>
-#include <QQmlEngine>
-
-void usage()
-{
- exit(0);
-}
-
-int main(int argc, char* argv[])
-{
- QGuiApplication app(argc,argv);
- QQuickView view;
- QUrl launchFile = QUrl::fromLocalFile(QLatin1String("tweetsearch.qml"));
- if (app.arguments().contains(QLatin1String("-help")))
- usage();
- view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));
- view.setSource(launchFile);
- view.show();
- return app.exec();
-}
-
+#include "../../shared/shared.h"
+DECLARATIVE_EXAMPLE_MAIN(tweetsearch)