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