main.cpp Example File
bluetoothsppchat/src/main.cpp
#include <bb/cascades/AbstractPane>
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <QLocale>
#include <QTranslator>
#include "BTController.hpp"
#include "ChatManager.hpp"
#include "DeviceListing.hpp"
#include "LocalDeviceInfo.hpp"
#include "RemoteDeviceInfo.hpp"
using namespace bb::cascades;
Q_DECL_EXPORT int main(int argc, char **argv)
{
qmlRegisterType<ChatManager>();
qmlRegisterType<DeviceListing>();
qmlRegisterType<LocalDeviceInfo>();
qmlRegisterType<RemoteDeviceInfo>();
Application app(argc, argv);
QTranslator translator;
const QString locale_string = QLocale().name();
const QString filename = QString::fromLatin1("bluetoothsppchat_%1").arg(locale_string);
if (translator.load(filename, "app/native/qm")) {
app.installTranslator(&translator);
}
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(&app);
qml->setContextProperty("_btController", new BTController(&app));
AbstractPane *root = qml->createRootObject<AbstractPane>();
app.setScene(root);
return Application::exec();
}