BlackBerry 10 Cascades – console.log() and qDebug() output

This snippet of code will allow you to see the output of qDebug and console.log from the Momentics IDE when developing for BlackBerry 10.

First we need to add this function to the main.cpp file:


void myMessageOutput(QtMsgType type, const char* msg){
Q_UNUSED(type);
fprintf(stdout, "%s\n", msg);
fflush(stdout);
}

Inside our main() function, add this:

//Message Handler
qInstallMsgHandler(myMessageOutput);

Now you will be able to see the output in the IDE while debugging your application, make sure to comment the qInstallMsgHandler line before exporting the Release version of your application.

N900 Mer boot to QMLViewer

The following kickstart files allows the n900 to boot into qmlviewer, I’m going to highlight just the bottom of it, with the next lines we create the launcher for the qmlviewer and then create a symbolic link to make it the default desktop environment.

cat > /usr/share/xsessions/x-meego-qmlviewer.desktop << EOF
[Desktop Entry]
Version=1.0
Name=qmlviewer session
Exec=/usr/bin/qmlviewer
Type=Application
EOF

# Set symlink pointing to .desktop file
ln -sf x-meego-qmlviewer.desktop /usr/share/xsessions/default.desktop

Here is a video of N900 booting:

And the full kickstarter file: