diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-06-04 19:54:51 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-05 16:05:55 +0200 |
commit | d3edc05b787ad9b079b36a2e509420fa715d66dc (patch) | |
tree | 9efce335cf67786de7c7419630c415c807388516 | |
parent | ca06986af37dad834afe7f6c81eb20d0751c6d78 (diff) | |
download | qtquickcontrols-d3edc05b787ad9b079b36a2e509420fa715d66dc.tar.gz |
TableView: Reset dragged header position if not moved
The user expects the "ghost" header to be aligned with the actual
column header when he starts dragging it.
Change-Id: Ifccf633403a72fe8448132fe6c349a85acba28d7
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r-- | src/controls/TableView.qml | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml index c04ba971..c9cbf452 100644 --- a/src/controls/TableView.qml +++ b/src/controls/TableView.qml @@ -1033,11 +1033,16 @@ ScrollView { readonly property int textAlignment: modelData.horizontalAlignment } parent: tableHeader - x: headerRowDelegate.x - listView.contentX + x: __implicitX + property double __implicitX: headerRowDelegate.x - listView.contentX width: modelData.width height: parent.height sourceComponent: root.headerDelegate visible: headerClickArea.pressed + onVisibleChanged: { + if (!visible) + x = Qt.binding(function () { return __implicitX }) + } opacity: 0.5 } |