From 4578a6fcba8b590a4a9b75559f7fcb80c3037c80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Kundr=C3=A1t?= Date: Tue, 16 Oct 2012 19:41:16 +0200 Subject: [PATCH] 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 --- examples/demos/tweetsearch/main.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/examples/demos/tweetsearch/main.cpp b/examples/demos/tweetsearch/main.cpp index 211d3eb..8b1d596 100644 --- a/examples/demos/tweetsearch/main.cpp +++ b/examples/demos/tweetsearch/main.cpp @@ -37,27 +37,5 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include -#include -#include -#include - -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) -- 2.7.4