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_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_p.h')
-rw-r--r-- | src/quicktemplates2/qquickdrawer_p_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdrawer_p_p.h b/src/quicktemplates2/qquickdrawer_p_p.h index f14c36dd..b7555c3e 100644 --- a/src/quicktemplates2/qquickdrawer_p_p.h +++ b/src/quicktemplates2/qquickdrawer_p_p.h @@ -68,6 +68,7 @@ public: qreal positionAt(const QPointF &point) const; void reposition() override; + void resizeOverlay() override; bool startDrag(QQuickWindow *window, QMouseEvent *event); bool grabMouse(QMouseEvent *event); @@ -80,6 +81,8 @@ public: bool prepareEnterTransition() override; bool prepareExitTransition() override; + void setEdge(Qt::Edge edge); + Qt::Edge edge; qreal offset; qreal position; |