From 244356ba182c2807ef9b15eb71ac16a568d65642 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 15 Sep 2016 10:09:36 +0200 Subject: QQuickDrawer: allow resizing and positioning Make QQuickDrawer re-use QQuickPopup's reposition() implementation. This way QQuickDrawer gains support for proper positioning and margins "for free". Now it is possible to place Drawer below the window header, for instance: import QtQuick 2.0 import QtQuick.Controls 2.0 ApplicationWindow { id: window visible: true header: ToolBar { } Drawer { y: header.height width: window.width * 0.6 height: window.height - header.height } } [ChangeLog][Controls][Drawer] Made it possible to control the vertical position of a horizontal drawer, and vice versa. This allows placing a drawer below a header/toolbar, for instance. Task-number: QTBUG-55360 Change-Id: I63621195efeefa2ea88935d676771b392e0a4030 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickdrawer_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quicktemplates2/qquickdrawer_p.h') diff --git a/src/quicktemplates2/qquickdrawer_p.h b/src/quicktemplates2/qquickdrawer_p.h index e694e27b..bada1344 100644 --- a/src/quicktemplates2/qquickdrawer_p.h +++ b/src/quicktemplates2/qquickdrawer_p.h @@ -87,6 +87,8 @@ protected: void mouseUngrabEvent() override; bool overlayEvent(QQuickItem *item, QEvent *event) override; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + private: Q_DISABLE_COPY(QQuickDrawer) Q_DECLARE_PRIVATE(QQuickDrawer) -- cgit v1.2.3