Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick
- import QtQuick.Controls 2.15
- import QtQuick.Layouts 1.15
- import TreeViewExample 1.0
- ApplicationWindow {
- id: root
- width: 500
- height: 500
- visible: true
- title: qsTr("Tree Example")
- Drawer {
- id: topDrawer
- width: root.width
- modal: false
- edge: Qt.TopEdge
- closePolicy: Drawer.NoAutoClose
- dragMargin: 0
- contentData: RowLayout {
- anchors.fill: parent
- Label {
- text: "Root item"
- Layout.leftMargin: 10
- }
- }
- Component.onCompleted: topDrawer.open()
- }
- Item {
- Keys.onPressed: {
- if(event.key === Qt.Key_F1) {
- if(topDrawer.opened()) {
- topDrawer.close()
- } else {
- topDrawer.open()
- }
- }
- }
- }
- Shortcut {
- sequence: "Esc"
- onActivated: {
- if(topDrawer.opened) {
- topDrawer.close()
- } else {
- topDrawer.open()
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement