diff options
author | Jan Kundrát <jkt@flaska.net> | 2012-10-16 19:41:16 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-16 20:17:36 +0200 |
commit | 4578a6fcba8b590a4a9b75559f7fcb80c3037c80 (patch) | |
tree | 53e0d4c67e19fc9107c9bb0a0cd58ef9436c0511 /examples | |
parent | 03c10cbfbe853a1a0790b419242aedabc655b0dc (diff) |
Use the shared boilerplate code in the tweetsearch demo
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>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/demos/tweetsearch/main.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/examples/demos/tweetsearch/main.cpp b/examples/demos/tweetsearch/main.cpp index 211d3eb07b..8b1d59679c 100644 --- a/examples/demos/tweetsearch/main.cpp +++ b/examples/demos/tweetsearch/main.cpp @@ -37,27 +37,5 @@ ** $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) |