0
我想在qt快速應用程序的背景下從網絡攝像頭呈現視頻。 我用這個代碼5.1.1的文件來渲染測試視頻:使用QtQuick進行視頻播放
import QtQuick 2.0
import QtMultimedia 5.0
Item {
MediaPlayer {
id: mediaplayer
source: "groovy_video.mp4"
}
VideoOutput {
anchors: parent.fill
source: mediaplayer
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: mediaplayer.play();
}
}
我沒有QtQuick經驗,如果連的例子(未修改)工作是雙萬分:
Invalid property assignment: "anchors" is a read-only property
anchors: parent.fill
什麼是錯的?
它的錯誤與文檔,正確的語法都沒有 「錨:parent.fill」,而是 「anchors.fill:父」(如在鼠標區域)。哪一頁文件?爲了修復它 – gbdivers
@Guillaume Belz here http://qt-project.org/doc/qt-5.0/qtmultimedia/qml-qtmultimedia5-mediaplayer.html – iMath