VerticalHeaderView.qml 820 B

123456789101112131415161718192021
  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. T.VerticalHeaderView {
  7. id: control
  8. // The contentWidth of TableView will be zero at start-up, until the delegate
  9. // items have been loaded. This means that even if the implicit width of
  10. // VerticalHeaderView should be the same as the content width in the end, we
  11. // need to ensure that it has at least a width of 1 at start-up, otherwise
  12. // TableView won't bother loading any delegates at all.
  13. implicitWidth: Math.max(1, contentWidth)
  14. implicitHeight: syncView ? syncView.height : 0
  15. delegate: VerticalHeaderViewDelegate { }
  16. }