我尝试使用Controls2
Drawer
在父项目中制作自上而下的抽屉。如果我设置edge.QtTopEdge
,程序会挂起。但它适用于QtLeftEdge
。
我做错了什么。
这是代码,
import QtQuick 2.7
import QtQuick.Controls 2.1
ApplicationWindow
{
visible: true
width: 800
height: 1024
Item
{
id: area
anchors.fill: parent
Column
{
width: parent.width
Rectangle
{
width: parent.width
height: 100
color: "blue"
}
Rectangle
{
id: yellowbit
width: parent.width
height: area.height - 100
color: "yellow"
}
}
}
Drawer
{
// i want to put the drawer within the "yellowbit"
id: drawer
width: yellowbit.width
height: yellowbit.height
parent: yellowbit
// comment this out and it works as a left drawer
// but as a top drawer, it hangs up
edge: Qt.TopEdge
Rectangle
{
anchors.fill: parent
color: "red"
}
}
}
感谢您的帮助