Drawer QML Type

A side panel control. More...

Import Statement: import Qt.labs.controls 1.0
Inherits:

Container

Properties

Signals

Methods

Detailed Description

Drawer provides a swipe-based side panel, similar to those often used in touch interfaces to provide a central location for navigation.

Drawer can be positioned at any of the four edges of the content item.
In this image, it is against the left edge of the window.

The drawer is then opened by "dragging" it out from the left edge
of the window.

In the image above, the application's contents are "pushed" across the screen. This is achieved by applying a translation to the contents:

transform: Translate {
    x: (1.0 - drawer.position) * listview.width
}

If you would like the application's contents to stay where they are when the drawer is opened, don't apply a translation.

Note: Types in the Qt.labs module are not guaranteed to remain compatible in future versions.

See also SwipeView, Customizing Drawer, Navigation Controls, and Container Controls.

Property Documentation

animation : Animation

This property holds the animation for the position property. It is used to animate the drawer's movement.

If no valid animation is set, the drawer's movement will not be animated.


contentItem : Item

This property holds the content item that the drawer displays when opened.


edge : enumeration

This property holds the edge of the content item at which the drawer will open from. The acceptable values are:

ConstantDescription
Qt.TopEdgeThe top edge of the content item.
Qt.LeftEdgeThe left edge of the content item (default).
Qt.RightEdgeThe right edge of the content item.
Qt.BottomEdgeThe bottom edge of the content item.

position : real

This property holds the position of the drawer relative to its final destination. That is, the position will be 0 when the drawer is fully closed, and 1 when fully open.


Signal Documentation

void clicked()

This signal is emitted when the drawer is clicked.


Method Documentation

void close()

This method closes the drawer, animating the movement if a valid animation has been set.


void open()

This method opens the drawer, animating the movement if a valid animation has been set.


© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.