Qt Mobility For n900 (maemo)

  • Hello all,

    I'm trying to program a video recorder for the nokia n900 phone, however I'm running into some problems. The following code I can get to compile and run on the simulator, but when I switch environments to the maemo device, the libraries Qcamera, and QCameraViewFinder arn't recognized, and I get errors such as "QCamera no such file or directory".

    I'm not sure why this should be happening, as all I'm changing is the build environment (even before I compile, the green underlines to indicate a problem appear for Qcamera and QCameraViewFinder). I would assume then that it's an issue with the build environments linking???

    On another note, I am using QT Mobility 1.1.1, and the phone only supports 1.0.2, but again these problems are appearing even before I compile.

    Here is my code:


    @QT += core gui

    TARGET = TestProject
    TEMPLATE = app

    SOURCES += main.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    CONFIG += mobility
    MOBILITY += systeminfo

    QT += maemo5

    symbian {
    TARGET.UID3 = 0xec63c307
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000

    unix:!symbian {
    maemo5 {
    target.path = /opt/usr/bin
    } else {
    target.path = /usr/local/bin
    INSTALLS += target


    @#include <QApplication>
    #include <QLabel>
    #include <QSystemInfo> //(1)
    #include <QVideoWidget>
    #include <Qcamera>
    #include <QtMultimedia/QtMultimedia>
    #include <QCameraViewfinder>
    #include <QVideoWidget>
    #include <mainwindow.h>
    #include <ui_mainwindow.h>
    #include <QMediaRecorder>


    int main(int argc, char argv[])
    QApplication app(argc, argv);
    MainWindow mainWindow;
    camera = new QCamera;

    // get a convenience ptr to ui
    Ui::MainWindow* ui = mainWindow.GetUi();
    QWidget* viewFinderWidget = new QWidget(ui->viewFinderDisplay);
    QMediaRecorder* mediaRecorder = new QMediaRecorder(camera,viewFinderWidget);
    // set the camera viewfinder to our viewfinder
    QCameraViewfinder* viewFinder = new QCameraViewfinder(viewFinderWidget);
    // test label
    QLabel* whatevs = new QLabel(viewFinderWidget);
    return app.exec();


    Any advice would be greatly appreciated as I'm basically pulling my hair out at this point.

  • can you copy paste the console out put. Also which is your existing build environment and SDK version for which it compile properly.

  • According to the docs at:

    Only Qt Mobility 1.0.2 is supported on the SDK for Maemo 5, but those camera classes are introduced in 1.1 (if I remember correctly).

    One solution is to use the Scratchbox and install all the needed packages manually.
    Probably you can just install Qt Mobility 1.1.* packages with the SDK using some hacks too??

  • We have already on the repositories experimental versions of qt mobility 1.1 and 1.2. Haven't tested them myself but they are there.

  • I had same problems when trying to use mobility with maemo target. My n900 has the newest mobility packages installed but maemo simulator doesn't know about that I suppose. When I switched target to symbian simulator it compiled.

  • It is possible to update the "libraries" on qt creator but it is unsupported and hard to do.
    You best bet is to use a linux box with scratchbox to compile the application.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.