main.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* #ident "$Id: $"
  2. * @author: rzr@gna.org - rev: $Author: rzr$
  3. * Copyright: See README file that comes with this distribution
  4. *****************************************************************************/
  5. #include "config.h"
  6. #include <QtGui/QApplication>
  7. #include "qmlapplicationviewer.h"
  8. #include "redak.h"
  9. Q_DECL_EXPORT
  10. int main(int argc, char *argv[])
  11. {
  12. QScopedPointer<QApplication> app(createApplication(argc, argv));
  13. qmlRegisterType<Redak>("Redak", 1, 1, "Redak");
  14. QmlApplicationViewer viewer;
  15. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  16. QString filepath="";
  17. if ( argc > 1 ) {
  18. char const * const p = argv[1];
  19. filepath = QString(p);
  20. }
  21. QVariant variant(filepath); // variant
  22. viewer.rootContext()->setContextProperty("parentFilePath", variant );
  23. QString filename("qml/redak/");
  24. QString platform("desktop");
  25. #if defined Q_WS_SIMULATOR
  26. # define Q_OS_SYMBIAN 1
  27. //# define Q_WS_HARMATTAN 1
  28. #endif
  29. #if defined(MEEGO_EDITION_HARMATTAN)
  30. # define Q_WS_HARMATTAN 1
  31. #endif
  32. #if defined(Q_WS_MAEMO_5)
  33. #elif defined(Q_WS_S60)
  34. #endif
  35. #if defined Q_OS_SYMBIAN
  36. platform = QString("symbian");
  37. #else // #if defined Q_WS_X11 && defined Q_OS_LINUX && // && defined Q_WS_HARMATTAN
  38. platform = QString("meego");
  39. //#elif defined CONFIG_LOCAL_PLATFORM_ANDROID
  40. // platform = QString("symbian");
  41. #endif
  42. filename += platform;
  43. filename += "/main.qml";
  44. viewer.setMainQmlFile( filename );
  45. viewer.showExpanded();
  46. return app->exec();
  47. }