-2
我想创建Qt应用程序,在视频和图像之间可以更改视图的位置取决于调用的函数。还有就是我.qml文件结构的简单的例子:在QML中切换图像和视频
ApplicationWindow {
Rectangle {
Rectangle {
id: Container
function dispImage(_title, _path)
{
//show imgae
}
function dispVideo(_title, _path)
{
//show video
}
Rectangle {
id: titleContainer
Text {
id: title
}
}
Rectangle {
id: image
Image {
id: image
}
}
Rectangle {
id: video
Image {
id: image
}
}
}
}
我应该使用哪一种机制?这可能通过从代码中调用适当的函数来实现吗?