Qt MultmediaKit



  • Hello,

    I am running QtCreator 2.4.1 Based on Qt 4.7.4 on MacOSX 10.7.2

    If possible I would like to know how to use the Qt MultimediaKit in a QML application and run it in qmlviewer.

    I have been trying to run the following example

    @import Qt 4.7
    import QtMultimediaKit 1.1

    Text {
    text: "Click Me!";
    font.pointSize: 24;
    width: 150; height: 50;

     Audio {
         id: playMusic
         source: "music.wav"
     }
     MouseArea {
         id: playArea
         anchors.fill: parent
         onPressed:  { playMusic.play() }
     }
    

    }@

    But I keep getting the following error message:

    @module "QtMultimediaKit" is not installed
    import QtMultimediaKit 1.1 @

    Is there something I am missing when installing QtSDK? Are there any paths that need to be set? I would really appreciate your help with this issue.

    Best,

    bamsa



  • Hello,

    I am trying to do the same in MacOS X 10.7.2.

    I am trying to run the following example in qmlviewer:

    @import QtQuick 1.1
    import Qt 4.7
    import QtMultimediaKit 1.1

    Rectangle {
    width: 360
    height: 360

    Audio {
        id: playMusic
        source: "superstar.mp3"
    }
    
    MouseArea {
        id: playArea
        anchors.fill: parent
        onPressed:  { playMusic.play() }
    }
    

    }@

    I copied
    @<path_to>/QtSDK/Simulator/Qt/4.8.0/gcc/imports/QtMultimediaKit@

    to

    @<path_to>/QtSDK/Desktop/Qt/4.8.0/gcc/imports/@

    but I am getting the following error message

    @plugin cannot be loaded for module "QtMultimediaKit": The plugin '<path_to>/QtSDK/Desktop/Qt/4.8.0/gcc/imports/QtMultimediaKit/libdeclarative_multimedia.dylib' uses incompatible Qt library. Expected build key "macosx macx-cocoa g++-4 full-config", got "simulator macosx macx-cocoa g++-4 full-config"
    import QtMultimediaKit 1.1
    ^ @

    Any help with this issue will be really appreciated. I have been struggling with this for a while now.

    Best,



  • I moved the second post from another thread to here, as it seems to be more or less the same topic.



  • try this:

    when I forget to modify the .pro file the result is the same as yours
    I don´t know if this woks in mac, I use windows, go to your *.pro file and find this two lines:
    @

    CONFIG += mobility

    MOBILITY +=

    @
    now delete this symbol # and this is the result:
    @
    CONFIG += mobility
    MOBILITY += multimedia
    @
    this should works, dont forget to write multimedia

    [Edit: Be sure and wrap code samples in @ tags; mlong]



  • Hi,

    Thank you very much for your reply.

    Unfortunately, I have tried that before but it didn't work. I keep getting the same error.

    I have an additional question though. Did you go over any particular process to install qt mobility and the multimedia kit in your system? Did you have to set any paths to make it work? Are you using Qt SDK? Which Qt libraries version? I really appreciate your help and time with this.

    Best,

    bamsa



  • I had this problem. Installing the package libdeclarative-multimedia fixed it on Ubuntu.



  • Does it work now ?



  • Where from did you get the QtMultimediaKit ?



  • [quote author="aabc" date="1352733663"]Does it work now ?[/quote]

    Yes, works fine.
    I installed this package: http://packages.ubuntu.com/quantal/libdeclarative-multimedia


Log in to reply
 

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