Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. customer scrollbar does not show up in TableView
Forum Updated to NodeBB v4.3 + New Features

customer scrollbar does not show up in TableView

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 208 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • JoeCFDJ Offline
    JoeCFDJ Offline
    JoeCFD
    wrote on last edited by JoeCFD
    #1

    customerized scrollbar shows up if HorizontalHeaderView is removed.
    If HorizontalHeaderView is added, TableView is not displayed and an error follows:
    QML TableView: Cannot anchor to an item that isn't a parent or sibling

    Both HorizontalHeaderView and TableView are inside ScrollView. What is wrong? They are not siblings anymore inside ScrollView? If ScrollView part is removed, scrolling still works, but no scrollbar is displayed.

    GroupBox {
        id: root
    
        label: Label {
            id: titleLabel
            text: qsTr( "TestTable" )
        }
    
        ScrollView {
            id: packageListScrollView
            anchors.fill: parent
            ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
            clip: true
    
            HorizontalHeaderView {
                 id: packageListTableHeader
                 syncView: packageListTable 
                anchors.top: parent.top
    
                 delegate: Rectangle {}
           }
    
          TableView {
              id: packageListTable        
             anchors.top: packageListTableHeader.bottom
              clip: true
    
              model: tableViewModel;
    
              delegate: Rectangle {}
             }
    
            ScrollBar.vertical: ScrollBar {
                anchors.right: parent.right
                policy: ScrollBar.AsNeeded
    
                // Gutter/Trough
            }
        }
    }
    
    
    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      @JoeCFD said in customer scrollbar does not show up in TableView:

      TableView

      TableView does not need ScrollView and its ScrollBar.vertical is ok.

      1 Reply Last reply
      0
      • JoeCFDJ JoeCFD has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved