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. QtQuick.Dialogs: Dialog, anchors
Forum Updated to NodeBB v4.3 + New Features

QtQuick.Dialogs: Dialog, anchors

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.3k Views 2 Watching
  • 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.
  • M Offline
    M Offline
    morte
    wrote on last edited by p3c0
    #1

    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

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Babalas
      wrote on last edited by
      #2

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

      p3c0P 1 Reply Last reply
      0
      • B Babalas

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

        p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        @Babalas Try setting TableView as a contentItem of Dialog.

        157

        1 Reply Last reply
        0

        • Login

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