Qt有一個神奇的組件,那就是Qtmultimedia,它有強(qiáng)大的功能:
看看很多多媒體功能,都能在這里找到,不僅audio、video,還有camera、sound和radio。文章來源:http://www.zghlxwxcb.cn/news/detail-823247.html
比如:文章來源地址http://www.zghlxwxcb.cn/news/detail-823247.html
import QtQuick 2.0
import QtMultimedia 5.0
Text {
text: "Press Me!"
font.pointSize: 24
Audio {
id: playMusic
source: "/usr/share/sounds/pop.wav" // Point this to a suitable sound file
}
MouseArea {
anchors.fill: parent
onPressed: playMusic.play()
}
}
import QtQuick 2.0
import QtMultimedia 5.0
Text {
text: "Press Me!"
font.pointSize: 24
SoundEffect {
id: playMusic
source: "/usr/share/sounds/pop.wav" // Point this to a suitable sound file
}
MouseArea {
anchors.fill: parent
onPressed: playMusic.play()
}
}
impor
到了這里,關(guān)于Qt/QML編程之路:QtMultimedia/Radio(41)的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!