main.cpp Example File
bbmcontacts/src/main.cpp
#include <bb/cascades/Application>
#include <QLocale>
#include <QTranslator>
#include "RegistrationHandler.hpp"
#include "ContactsDisplay.hpp"
#include "Contact.hpp"
using namespace bb::cascades;
Q_DECL_EXPORT int main(int argc, char **argv)
{
Application app(argc, argv);
qmlRegisterType<Contact>("com.example.contact", 1, 0, "Contact");
QTranslator translator;
const QString locale_string = QLocale().name();
const QString filename = QString::fromLatin1("bbmprofilebox_%1").arg(locale_string);
if (translator.load(filename, "app/native/qm")) {
app.installTranslator(&translator);
}
const QString uuid(QLatin1String(""));
RegistrationHandler *registrationHandler = new RegistrationHandler(uuid, &app);
ContactsDisplay *contactsDisplay = new ContactsDisplay(registrationHandler->context(), &app);
bool ok = QObject::connect(registrationHandler, SIGNAL(registered()), contactsDisplay, SLOT(show()));
Q_ASSERT(ok);
Q_UNUSED(ok);
return Application::exec();
}