怎么用QML做个简单的折叠菜单啊,分全捐
我是菜鸟,刚学qt,现在想用qml做个菜单
实现功能一::
点击主菜单,展开,显示子菜单
再次点击主菜单,闭合,隐藏子菜单。
主菜单可以上下拖动。
实现功能二:
当点击子菜单的时候,把子菜单的文本输出到整个窗口的hello world那里。
就实现这两个功能,界面我设计好了。你只要写下折叠效果的代码和输出文本的功能就行。
如果能帮我实现功能,分数全给,并且酌情给予适当话费奖励,请留下你的QQ号方便我联系你,我QQ457667976,验证:csdn
import QtQuick 2.0
Rectangle {
width: 360
height:600
//顶部显示模块
Rectangle{
id:texttop
width: 250
height:40
border.width: 1
x:60
y:30
color: "#ccc1c1"
radius: 10
Text {
id:title
text:"Hello World !"
font.pointSize: 13
anchors.centerIn: parent
}
}
//中间大矩形区域
Rectangle{
id:center
width: 260
height: 450
color: "#ccc1c1"
x:55
y:100
radius: 10
//测试模块A
Rectangle{
id:a
width: 200
height: 40
color: "green"
x:20
y:20
radius: 10
Text {
id:testA
text:"测试模块A"
style: Text.Raised
font.pointSize: 16
anchors.centerIn: parent
}
}
//测试模块B
Rectangle{
id:b
width: 200
height: 40
color: "blue"
x:20
y:80
radius: 10
Text {
id:testB
text:"测试模块B"
style: Text.Raised
font.pointSize: 16
anchors.centerIn: parent
}
}
//测试模块C
Rectangle{
id:c
width: 200
height: 40
color: "#f748f2"
x:20
y:140
radius: 10
Text {
id:testC
text:"测试模块C"
style: Text.Raised
font.pointSize: 16
anchors.centerIn: parent
}
}
//测试模块D
Rectangle{
id:d
width: 200
height: 40
color: "#f748f2"
x:20
y:200
radius: 10
Text {
id:testD
text:"测试模块D"
style: Text.Raised
font.pointSize: 16
anchors.centerIn: parent
}
}
}
}