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:
.pro
@QT += core gui
TARGET = TestProject
TEMPLATE = appSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
CONFIG += mobility
MOBILITY += systeminfo
multimediaQT += maemo5
symbian {
TARGET.UID3 = 0xec63c307
# TARGET.CAPABILITY +=
TARGET.EPOCSTACKSIZE = 0x14000
TARGET.EPOCHEAPSIZE = 0x020000 0x800000
}unix:!symbian {
maemo5 {
target.path = /opt/usr/bin
} else {
target.path = /usr/local/bin
}
INSTALLS += target
}@main:
@#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>QTM_USE_NAMESPACE //(2)
int main(int argc, char argv[])
{
QApplication app(argc, argv);
MainWindow mainWindow;
QCamera 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); camera->setViewfinder(viewFinder); // test label QLabel* whatevs = new QLabel(viewFinderWidget); whatevs->setText("whatevs"); //camera->setCaptureMode(QCamera::CaptureVideo); camera->start(); mediaRecorder->record(); mainWindow.show(); 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:
http://labs.qt.nokia.com/2011/05/04/qt-sdk-1-1-released/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??