Qt mobility on windows 7 desktop application



  • Hello,

    I created a desktop application that uses qt mobility and its module QtMultimediaKit. Under Ubuntu, I installed everything via the package manager and I could use qt mobility without doing anything else.

    Now I am trying to compile my application under windows 7. I downloaded Qt SDK version 1.2.1 which includes qt mobility. But when I try to create an application that uses mobility, it can't find the includes files. Here is an application exemple.
    The pro file:
    @QT += core gui

    CONFIG += mobility

    TARGET = testHelloWorld
    TEMPLATE = app
    MOBILITY = multimedia

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui
    @

    main.cpp
    @#include <QtGui/QApplication>
    #include "mainwindow.h"
    #include <QCamera>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    QCamera camera;
    MainWindow w;
    w.show();

    return a.exec&#40;&#41;;
    

    }
    @

    I got the following error:

    @D:\code\testMobility2-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug..\testMobility2\main.cpp:3: error: QCamera: No such file or directory@

    Someone know how I could activate propertly qt mobility for a windows desktop application? Last I tryed to to it by myslef by changing Path and other stuff I got worst issues so I prefer to don't do it by myself as I don't understand everything about compilation.

    Thanks in advance,

    Sincerly,

    Cédric



  • Ok so I found out.
    For those who want to know, you first have to understand that qt mobility for desktop is not part of the QtSDK. There is only qt mobility for symbian. So you need to get the source code and compile it. Since digia got Qt a fews days ago the mobility source download link wasn't working so I got it from git. You can do it from a git bash (download msysgit for instance).
    @cd /c/QtSDK
    git clone git://gitorious.org/qt-mobility/qt-mobility.git@
    Now you will have to compile it.
    Here are some instructions:
    http://doc.qt.digia.com/qtmobility/installation.html
    http://www.developer.nokia.com/Community/Wiki/Installing_Qt_Mobility_in_Qt_SDK_on_Windows_(former_Qt_desktop_SDK)
    I installed the mobility QMultimediaKit module dependencies and then from a windows bash (or qt bash), I did the compiling instructions.
    @cd <your qt mobility source folder>
    configure -prefix %QTDIR%
    mingw32-make
    mingw32-make install@
    But I got some mistakes so I only compiled QMultimediaKit, the only one I need:
    @configure -prefix C:\QtSDK\Desktop\Qt\4.7.4\mingw -modules multimedia@

    Finaly it worked and I can use qt mobility multimedia in a project. It doesn't work very well thought...in comparison to under linux. I can't snap pictures or register videos. And my webcam view size is increasing automatically. But a least I can see my webcam input.


Log in to reply
 

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