2

我正在尝试使用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"
        }
    }
}

谢谢你的帮助

4

0 回答 0