diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-09-15 10:09:36 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-09-21 21:39:47 +0000 |
commit | 244356ba182c2807ef9b15eb71ac16a568d65642 (patch) | |
tree | 15d6590511f983e98c909763a274bead9de9ee8b /src/quicktemplates2/qquickdrawer_p.h | |
parent | 175d0ea3f80af0ca32baec489d8ea66dd4ee3418 (diff) |
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 <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdrawer_p.h')
-rw-r--r-- | src/quicktemplates2/qquickdrawer_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
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) |