Fade out sound
-
I'm having problems getting Qt Mobility to work. First I thought it was because I was using Qt SDK 2010.05. So I installed the latest SDK (1.1.2) from http://qt.nokia.com/downloads/. Which claims to contain Qt Mobility version 1.1.3. However after installing I created a simple app from Qt documentation using QMediaPlayer, see http://doc.qt.nokia.com/qtmobility-1.1.3/quickstart.html.
If I try to compile it complains about the following:
#include <QMediaPlayer> main.cpp:2:24: error: QMediaPlayer: No such file or directory
QTM_USE_NAMESPACE main.cpp:6: error: expected constructor, destructor, or type conversion before 'int'
I must be missing out on something. Should I build Qt Mobility myself. I even can't seem to find the source files for it in the SDK directories :-s
-
AFAIK desktop Qt in QtSDK doesn't contain QtMobility. You have to build it manually or use one precompiled (if you use some package-based linux distro it will be easy to install it from repos).
-
It does contain it. The create project wizard even supports creating a mobile project. Which still feels weird since I am targeting a 52" inch desktop environment ;-)
This is the .pro file created (and my changes):
@
Add files and directories to ship with the application
by adapting the examples below.
file1.source = myfile
dir1.source = mydir
DEPLOYMENTFOLDERS = # file1 dir1
symbian:TARGET.UID3 = 0xE80DF1B4
Smart Installer package's UID
This UID is from the protected range
and therefore the package will fail to install if self-signed
By default qmake uses the unprotected range value if unprotected UID is defined for the application
and 0x2002CCCF value if protected UID is given to the application
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices
If your application uses the Qt Mobility libraries, uncomment
the following lines and add the respective components to the
MOBILITY variable.
CONFIG += mobility
MOBILITY += multimediaSOURCES += main.cpp mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.uiPlease do not modify the following two lines. Required for deployment.
include(deployment.pri)
qtcAddDeployment()
@
And here is my main.cpp:
@
#include "mainwindow.h"
#include <QApplication>
#include <QMediaPlayer>int main(int argc, char *argv[])
{
QApplication app(argc, argv);MainWindow mainWindow; mainWindow.setOrientation(MainWindow::ScreenOrientationAuto); mainWindow.showExpanded(); return app.exec();
}
@And it does not compile for previous posted reasons!
-
Qt Creator is only part of Qt SDK and another part is Qt library itself. Your errors really looks like QtM is missing, aren't they?
-
Yes, QtM appears to be missing. But when I go this url it says QtM is part of the SDK:
https://qt.nokia.com/products/qt-addons/mobility
That's also claimed on this page, from where I downloaded and installed the SDK:
https://qt.nokia.com/downloads
Check these screenshots from my system for more details:
http://www.vanmezelf.nl/images/screenshot.png
http://www.vanmezelf.nl/images/screenshot-2.png -
It can be part of mobile libraries (symbian, maemo), I'm not sure on this btw (I'm using mostly selfbuilded Qt or Qt from my linux repo).