QML的Window与ApplicationWindow

xiaoxiao2021-02-28  99

Qt Quick中ApplicationWindow与Window

ApplicationWindow需要导入QtQuick.Controls Window需要导入QtQuick.Window 。 默认不可见,需要设置visible:true才可见。 主要区别就是ApplicationWindow提供了简单的方式创建程序窗口,因为其有属性menuBar、toolBar、Tabview等属性,可以方便快速创建一个丰富的窗口。

ApplicationWindow { id: window visible: true menuBar: MenuBar { Menu { MenuItem {...} } Menu { MenuItem {...} } } toolBar: ToolBar { RowLayout { anchors.fill: parent ToolButton {...} } } TabView { id: myContent anchors.fill: parent ... } }
转载请注明原文地址: https://www.6miu.com/read-50963.html

最新回复(0)