QtQuick.Dialogs: Dialog, anchors



  • I have Dialog with TableView and im trying to set TableView to fill all available space of dialog window

    Dialog {
     title: "History"
     TableView {
      id: view
      //anchors.fill: parent
      anchors.top: parent.top; anchors.left: parent.left; 
      anchors.right: parent.right; //anchors.bottom: ???
    
      model: model
    
      TableViewColumn { title: "Date"; role: "date" }
      TableViewColumn { title: "Dist"; role: "distance" }
      TableViewColumn { title: "Avg speed"; role: "average_speed" }
      TableViewColumn { title: "Dur"; role: "duration" }
     }
    
     ListModel {
      id: model
            //...
     }
    }
    

    When im trying to set TableView's anchors to fill parent it draws broken:
    Image1

    When im trying to set each top, left, right, bottom anchors it's ok but i dont know what assign to bottom anchor (how to address top anchor of dialog buttons):
    image2



  • Did you find a solution to this? I've just run into an almost identical problem.


  • Moderators

    @Babalas Try setting TableView as a contentItem of Dialog.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.