main.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include <QtGui/QApplication>
  2. #include <QUrl>
  3. #include "qmlapplicationviewer.h"
  4. #include "MyXmppClient.h"
  5. #include "ima/minversemousearea.h"
  6. #include "rosterlistmodel.h"
  7. #include "chatslistmodel.h"
  8. #include "msglistmodel.h"
  9. #include "accountslistmodel.h"
  10. #include "qmlvcard.h"
  11. #include "meegimsettings.h"
  12. #include "smileslistmodel.h"
  13. #include "mysmiles.h"
  14. #include "xmppmuc.h"
  15. #include "harmattanfeed.h"
  16. #include "smthemelistmodel.h"
  17. #define MEEGIM_API_NAMESPACE "meegim"
  18. Q_DECL_EXPORT int main(int argc, char *argv[])
  19. {
  20. QScopedPointer<QApplication> app( createApplication(argc, argv) );
  21. qmlRegisterType<MInverseMouseArea>("InvMA", 1, 0, "InverseMouseArea");
  22. qmlRegisterType<MyXmppClient>(MEEGIM_API_NAMESPACE, 1, 0, "XmppClient" );
  23. qmlRegisterType<MeegIMSettings>(MEEGIM_API_NAMESPACE, 1, 0, "MeegIMSettings" );
  24. qmlRegisterType<QMLVCard>(MEEGIM_API_NAMESPACE, 1, 0, "XmppVCard" );
  25. qmlRegisterType<MySmiles>(MEEGIM_API_NAMESPACE, 1, 0, "MSmiles" );
  26. qmlRegisterType<XmppMuc>( MEEGIM_API_NAMESPACE, 1, 0, "XmppMuc" );
  27. qmlRegisterType<HarmattanFeed>( MEEGIM_API_NAMESPACE, 1, 0, "MEventFeed" );
  28. qmlRegisterUncreatableType<RosterListModel>(MEEGIM_API_NAMESPACE, 1, 0, "Roster", "Use xmppClient.roster instead");
  29. qmlRegisterUncreatableType<MsgListModel>(MEEGIM_API_NAMESPACE, 1, 0, "MessagesList", "");
  30. qmlRegisterUncreatableType<ChatsListModel>(MEEGIM_API_NAMESPACE, 1, 0, "ChatsList", "");
  31. qmlRegisterUncreatableType<AccountsListModel>(MEEGIM_API_NAMESPACE, 1, 0, "AccountsList", "Use settings.accounts instead");
  32. qmlRegisterUncreatableType<SmilesListModel>(MEEGIM_API_NAMESPACE, 1, 0, "SmilesList", "");
  33. qmlRegisterUncreatableType<QXmppMucManager>(MEEGIM_API_NAMESPACE, 1, 0, "QXmppMucManager", "");
  34. qmlRegisterUncreatableType<SmilesThemeListModel>(MEEGIM_API_NAMESPACE, 1, 0, "SmilesThemeList", "");
  35. QmlApplicationViewer viewer;
  36. viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  37. //viewer.setMainQmlFile(QLatin1String("qrc:/qml/main.qml"));
  38. viewer.setSource( QUrl(QLatin1String("qrc:/qml/main.qml")) );
  39. viewer.showExpanded();
  40. EventFilter ef;
  41. viewer.installEventFilter(&ef);
  42. return app->exec();
  43. }