VerticalHeaderView.qml 854 B

12345678910111213141516171819202122
  1. // Copyright (C) 2020 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. pragma ComponentBehavior: Bound
  5. import QtQuick.Templates as T
  6. import QtQuick.Controls.Universal
  7. T.VerticalHeaderView {
  8. id: control
  9. // The contentWidth of TableView will be zero at start-up, until the delegate
  10. // items have been loaded. This means that even if the implicit width of
  11. // VerticalHeaderView should be the same as the content width in the end, we
  12. // need to ensure that it has at least a width of 1 at start-up, otherwise
  13. // TableView won't bother loading any delegates at all.
  14. implicitWidth: Math.max(1, contentWidth)
  15. implicitHeight: syncView ? syncView.height : 0
  16. delegate: VerticalHeaderViewDelegate { }
  17. }