summaryrefslogtreecommitdiff
path: root/src/controls/TableView.qml
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-06-05 18:01:57 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-06 12:20:16 +0200
commitf04f0b8b4ed83025c02fdbed6ebb8105dee51479 (patch)
tree5d84e42e5a08c578421d55c56c373a4cd9220a9b /src/controls/TableView.qml
parentc3fe8736a8cd00581a33cbea62a752331e6bd619 (diff)
downloadqtquickcontrols-f04f0b8b4ed83025c02fdbed6ebb8105dee51479.tar.gz
TableView: Allow resizing and scrolling single-column tables
Also makes sure the resize handle is visible in desktop style. Task-number: QTBUG-39393 Change-Id: I44410c65e76b0a3221ea5fce713c1f1b69079947 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/TableView.qml')
-rw-r--r--src/controls/TableView.qml9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml
index de46469b..5feeac01 100644
--- a/src/controls/TableView.qml
+++ b/src/controls/TableView.qml
@@ -951,8 +951,8 @@ ScrollView {
delegate: Item {
id: headerRowDelegate
z:-index
- width: columnCount === 1 ? viewport.width + __verticalScrollBar.width : modelData.width
- implicitWidth: headerStyle.implicitWidth
+ width: modelData.width
+ implicitWidth: columnCount === 1 ? viewport.width + __verticalScrollBar.width : headerStyle.implicitWidth
visible: modelData.visible
height: headerStyle.height
@@ -967,6 +967,7 @@ ScrollView {
readonly property bool containsMouse: headerClickArea.containsMouse
readonly property int column: index
readonly property int textAlignment: modelData.horizontalAlignment
+ readonly property bool resizable: modelData.resizable
}
}
Rectangle{
@@ -1050,13 +1051,13 @@ ScrollView {
MouseArea {
id: headerResizeHandle
property int offset: 0
- property int minimumSize: 20
+ readonly property int minimumSize: 20
preventStealing: true
anchors.rightMargin: -width/2
width: Settings.hasTouchScreen ? Screen.pixelDensity * 3.5 : 16
height: parent.height
anchors.right: parent.right
- enabled: modelData.resizable && columnCount > 1
+ enabled: modelData.resizable && columnCount > 0
onPositionChanged: {
var newHeaderWidth = modelData.width + (mouseX - offset)
modelData.width = Math.max(minimumSize, newHeaderWidth)