diff options
Diffstat (limited to 'src/quickcontrols')
10 files changed, 60 insertions, 10 deletions
diff --git a/src/quickcontrols/basic/HorizontalHeaderView.qml b/src/quickcontrols/basic/HorizontalHeaderView.qml index 140c9f3ae8..a46cf31f49 100644 --- a/src/quickcontrols/basic/HorizontalHeaderView.qml +++ b/src/quickcontrols/basic/HorizontalHeaderView.qml @@ -8,7 +8,12 @@ T.HorizontalHeaderView { id: control implicitWidth: syncView ? syncView.width : 0 - implicitHeight: contentHeight + // The contentHeight of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit height of + // HorizontalHeaderView should be the same as the content height in the end, we + // need to ensure that it has at least a height of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitHeight: Math.max(1, contentHeight) delegate: Rectangle { // Qt6: add cellPadding (and font etc) as public API in headerview diff --git a/src/quickcontrols/basic/VerticalHeaderView.qml b/src/quickcontrols/basic/VerticalHeaderView.qml index a59e228d20..5ff9043f93 100644 --- a/src/quickcontrols/basic/VerticalHeaderView.qml +++ b/src/quickcontrols/basic/VerticalHeaderView.qml @@ -7,7 +7,12 @@ import QtQuick.Templates as T T.VerticalHeaderView { id: control - implicitWidth: contentWidth + // The contentWidth of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit width of + // VerticalHeaderView should be the same as the content width in the end, we + // need to ensure that it has at least a width of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitWidth: Math.max(1, contentWidth) implicitHeight: syncView ? syncView.height : 0 delegate: Rectangle { diff --git a/src/quickcontrols/fusion/HorizontalHeaderView.qml b/src/quickcontrols/fusion/HorizontalHeaderView.qml index aafe0fb2fd..8a84c6142b 100644 --- a/src/quickcontrols/fusion/HorizontalHeaderView.qml +++ b/src/quickcontrols/fusion/HorizontalHeaderView.qml @@ -8,7 +8,12 @@ T.HorizontalHeaderView { id: control implicitWidth: syncView ? syncView.width : 0 - implicitHeight: contentHeight + // The contentHeight of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit height of + // HorizontalHeaderView should be the same as the content height in the end, we + // need to ensure that it has at least a height of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitHeight: Math.max(1, contentHeight) delegate: Rectangle { // Qt6: add cellPadding (and font etc) as public API in headerview diff --git a/src/quickcontrols/fusion/VerticalHeaderView.qml b/src/quickcontrols/fusion/VerticalHeaderView.qml index 7ae2fcdd62..2e9ef6d753 100644 --- a/src/quickcontrols/fusion/VerticalHeaderView.qml +++ b/src/quickcontrols/fusion/VerticalHeaderView.qml @@ -7,7 +7,12 @@ import QtQuick.Templates as T T.VerticalHeaderView { id: control - implicitWidth: contentWidth + // The contentWidth of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit width of + // VerticalHeaderView should be the same as the content width in the end, we + // need to ensure that it has at least a width of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitWidth: Math.max(1, contentWidth) implicitHeight: syncView ? syncView.height : 0 delegate: Rectangle { diff --git a/src/quickcontrols/imagine/HorizontalHeaderView.qml b/src/quickcontrols/imagine/HorizontalHeaderView.qml index 140c9f3ae8..a46cf31f49 100644 --- a/src/quickcontrols/imagine/HorizontalHeaderView.qml +++ b/src/quickcontrols/imagine/HorizontalHeaderView.qml @@ -8,7 +8,12 @@ T.HorizontalHeaderView { id: control implicitWidth: syncView ? syncView.width : 0 - implicitHeight: contentHeight + // The contentHeight of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit height of + // HorizontalHeaderView should be the same as the content height in the end, we + // need to ensure that it has at least a height of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitHeight: Math.max(1, contentHeight) delegate: Rectangle { // Qt6: add cellPadding (and font etc) as public API in headerview diff --git a/src/quickcontrols/imagine/VerticalHeaderView.qml b/src/quickcontrols/imagine/VerticalHeaderView.qml index a59e228d20..5ff9043f93 100644 --- a/src/quickcontrols/imagine/VerticalHeaderView.qml +++ b/src/quickcontrols/imagine/VerticalHeaderView.qml @@ -7,7 +7,12 @@ import QtQuick.Templates as T T.VerticalHeaderView { id: control - implicitWidth: contentWidth + // The contentWidth of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit width of + // VerticalHeaderView should be the same as the content width in the end, we + // need to ensure that it has at least a width of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitWidth: Math.max(1, contentWidth) implicitHeight: syncView ? syncView.height : 0 delegate: Rectangle { diff --git a/src/quickcontrols/material/HorizontalHeaderView.qml b/src/quickcontrols/material/HorizontalHeaderView.qml index 671728c004..a90c4f0d75 100644 --- a/src/quickcontrols/material/HorizontalHeaderView.qml +++ b/src/quickcontrols/material/HorizontalHeaderView.qml @@ -10,7 +10,12 @@ T.HorizontalHeaderView { id: control implicitWidth: syncView ? syncView.width : 0 - implicitHeight: contentHeight + // The contentHeight of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit height of + // HorizontalHeaderView should be the same as the content height in the end, we + // need to ensure that it has at least a height of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitHeight: Math.max(1, contentHeight) delegate: Rectangle { // Qt6: add cellPadding (and font etc) as public API in headerview diff --git a/src/quickcontrols/material/VerticalHeaderView.qml b/src/quickcontrols/material/VerticalHeaderView.qml index e497d4a84c..f7b7ce9b5e 100644 --- a/src/quickcontrols/material/VerticalHeaderView.qml +++ b/src/quickcontrols/material/VerticalHeaderView.qml @@ -9,7 +9,12 @@ import QtQuick.Controls.Material.impl T.VerticalHeaderView { id: control - implicitWidth: contentWidth + // The contentWidth of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit width of + // VerticalHeaderView should be the same as the content width in the end, we + // need to ensure that it has at least a width of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitWidth: Math.max(1, contentWidth) implicitHeight: syncView ? syncView.height : 0 delegate: Rectangle { diff --git a/src/quickcontrols/universal/HorizontalHeaderView.qml b/src/quickcontrols/universal/HorizontalHeaderView.qml index 878fb1e10e..3700008e92 100644 --- a/src/quickcontrols/universal/HorizontalHeaderView.qml +++ b/src/quickcontrols/universal/HorizontalHeaderView.qml @@ -11,7 +11,12 @@ T.HorizontalHeaderView { id: control implicitWidth: syncView ? syncView.width : 0 - implicitHeight: contentHeight + // The contentHeight of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit height of + // HorizontalHeaderView should be the same as the content height in the end, we + // need to ensure that it has at least a height of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitHeight: Math.max(1, contentHeight) delegate: Rectangle { // Qt6: add cellPadding (and font etc) as public API in headerview diff --git a/src/quickcontrols/universal/VerticalHeaderView.qml b/src/quickcontrols/universal/VerticalHeaderView.qml index 189bed0906..43f8e6aeb8 100644 --- a/src/quickcontrols/universal/VerticalHeaderView.qml +++ b/src/quickcontrols/universal/VerticalHeaderView.qml @@ -10,7 +10,12 @@ import QtQuick.Controls.Universal.impl T.VerticalHeaderView { id: control - implicitWidth: contentWidth + // The contentWidth of TableView will be zero at start-up, until the delegate + // items have been loaded. This means that even if the implicit width of + // VerticalHeaderView should be the same as the content width in the end, we + // need to ensure that it has at least a width of 1 at start-up, otherwise + // TableView won't bother loading any delegates at all. + implicitWidth: Math.max(1, contentWidth) implicitHeight: syncView ? syncView.height : 0 delegate: Rectangle { |