smartsignals.cpp Example File
bpstoqml/src/smartsignals.cpp
#include "AccelerometerService.hpp"
#include "AzimuthPitchRollService.hpp"
#include "BPSMonitor.hpp"
#include "GeolocationService.hpp"
#include "LightService.hpp"
#include "MagnetometerService.hpp"
#include "ProximityService.hpp"
#include "SmartSignalsApp.hpp"
#include "VirtualKeyboardService.hpp"
#include <bb/cascades/Application>
#include <bb/cascades/Container>
#include <QtCore/QObject>
#include <QtCore/QLocale>
#include <QtCore/QTranslator>
using ::bb::cascades::Application;
Q_DECL_EXPORT int main(int argc, char **argv) {
const char *uri = "bb.cascades.bps";
qmlRegisterType<bb::cascades::bps::BPSMonitor>(uri, 1, 0, "BPSMonitor");
qmlRegisterInterface<bb::cascades::bps::BlackBerryPlatformService>("BlackBerryPlatformService");
qmlRegisterType<bb::cascades::bps::VirtualKeyboardService>(uri, 1, 0, "VirtualKeyboardService");
qmlRegisterType<bb::cascades::bps::GeolocationService>(uri, 1, 0, "GeolocationService");
qRegisterMetaType<bb::cascades::bps::AccelerometerService::SensorAccuracy>("SensorAccuracy");
qmlRegisterType<bb::cascades::bps::AccelerometerService>(uri, 1, 0, "AccelerometerService");
qmlRegisterType<bb::cascades::bps::MagnetometerService>(uri, 1, 0, "MagnetometerService");
qmlRegisterType<bb::cascades::bps::ProximityService>(uri, 1, 0, "ProximityService");
qmlRegisterType<bb::cascades::bps::AzimuthPitchRollService>(uri, 1, 0, "AzimuthPitchRollService");
qmlRegisterType<bb::cascades::bps::LightService>(uri, 1, 0, "LightService");
Application app(argc, argv);
QTranslator translator;
QString locale_string = QLocale().name();
QString filename = QString("SmartSignals_%1").arg(locale_string);
if (translator.load(filename, "app/native/qm")) {
app.installTranslator(&translator);
}
SmartSignalsApp mainApp;
return Application::exec();
}