Well, my problem is the sound that did not come out because inside the call of the object "Qt.createQmlObject ()" I can not use the QtMultimedia 5.0 module with a "muted:" property that receives the value of!! Qt.application.active ; " I get an error message
file:///C:/Users/joaovictor/Desktop/demarsia/conteudo/EfeitoSonoro.qml:7: Error: Qt.createQmlObject(): failed to create object:
file:///C:/Users/joaovictor/Desktop/demarsia/conteudo/inline:1:143: Cannot assign to non-existent property "muted"
(the module .qml)
O módulo EfeitoSonoro.qml:qterr.jpg
import QtQuick 2.0
import QtMultimedia 5.0
//Proxies a SoundEffect if QtMultimedia is installed
Item {
id: container
property QtObject effect: Qt.createQmlObject('import QtMultimedia 5.0; EfeitoSonoro{ source: " ' + container.source + ' "; muted: !Qt.application.active } ', container);
property url source: ""
onSourceChanged: if (effect != null) effect.source = source;
function play() {
if (effect != null)
effect.play();
}
}
import QtQuick 2.0
import QtMultimedia 5.0
//Proxies a SoundEffect if QtMultimedia is installed
Item {
id: container
property QtObject effect: Qt.createQmlObject('import QtMultimedia 5.0; EfeitoSonoro{ source: " ' + container.source + ' "; muted: !Qt.application.active } ', container);
property url source: ""
onSourceChanged: if (effect != null) effect.source = source;
function play() {
if (effect != null)
effect.play();
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks