summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-06-04 19:54:51 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-05 16:05:55 +0200
commitd3edc05b787ad9b079b36a2e509420fa715d66dc (patch)
tree9efce335cf67786de7c7419630c415c807388516
parentca06986af37dad834afe7f6c81eb20d0751c6d78 (diff)
downloadqtquickcontrols-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.qml7
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
}