Results 1 to 2 of 2

Thread: stretch the qtable widget

  1. #1
    Join Date
    Sep 2015
    Location
    Cairo
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default stretch the qtable widget

    I have another problem after doing this, header then cut like the this image Attachment 11373

    the second column in the first table is [Manufacturer]
    the second column header is [Apical Diameter] and the third column is [Occlusal Diameter]

    how can i make the table fit width of both header and content and also the columns resize itself to the widget's width.

    thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: stretch the qtable widget

    If the column widths all fit the column contents then you cannot also fit exactly the width of the viewport on the screen.
    If you make one or more columns stretch then the columns will stretch to fill the width of the viewport. The width of those columns will no longer be related to their content. If multiple columns can stretch then they share the available width after the other columns are sized. You achieve these settings with a combination of calls to setSectionResizeMode(), and possibly other size controlling/limiting functions, on the horizontal header.

    In the first table i would Set section 2 to stretch and the others to resize to contents.

Similar Threads

  1. Qt QSplitter stretch widget out of container
    By karankumar1609 in forum Qt Programming
    Replies: 0
    Last Post: 20th September 2013, 13:46
  2. Qt Designer widget layout: dont stretch vertically
    By tuli in forum Qt Tools
    Replies: 1
    Last Post: 8th September 2012, 14:34
  3. QTable Widget
    By kavinsiva in forum Newbie
    Replies: 5
    Last Post: 23rd October 2009, 13:50
  4. QTable Widget
    By csvivek in forum Qt Programming
    Replies: 2
    Last Post: 12th May 2008, 13:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.