libbb/Application_processStateChanged.cpp

This example illustrates how to connect to the Application processStateChanged(bb::ProcessState::Type) signal in C++.
#include <bb/Application>
#include <bb/ProcessState>
#include <QObject>

class TestObject: public QObject {
Q_OBJECT
public Q_SLOTS:
    void onProcessStateChanged(bb::ProcessState::Type processState);
};

void TestObject::onProcessStateChanged(bb::ProcessState::Type processState) {
    // Do something here
}

int main(int argc, char **argv) {
    bb::Application app(argc, argv);
    TestObject testObject;

    QObject::connect(&app, SIGNAL( processStateChanged(bb::ProcessState::Type) ), &testObject, SLOT( onProcessStateChanged(bb::ProcessState::Type) ));

    return app.exec();
}

Overview

Last modified: 2014-03-13

comments powered by Disqus