-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
}
}
}
}
我應該使用哪一種機制?這可能通過從代碼中調用適當的函數來實現嗎?