Results 1 to 3 of 3

Thread: Is setting setColumnWidth of QTableWidget not possible in Qt Designer?

  1. #1
    Join Date
    Jul 2018
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Question Is setting setColumnWidth of QTableWidget not possible in Qt Designer?

    capture.PNG

    I can not find both setColumnWidth and resizeColumnsToContents in Qt desginer. (Though I prefer former to latter)
    I can do it manually, but then I have to add additional code and I think it is not desirable.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Is setting setColumnWidth of QTableWidget not possible in Qt Designer?

    I have to add additional code and I think it is not desirable.
    Well, sometimes you just have to bite the bullet and actually write a few lines of code instead of just dragging and dropping icons. You -can- use Qt Designer to set the minimum and default section sizes for the horizontal header.

    In any case, how could Designer know how to apply a call to resizeColumnsToContents when all it has is an empty table? It isn't until run time that you put things in the table cells.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jul 2018
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is setting setColumnWidth of QTableWidget not possible in Qt Designer?

    Then how about just applying different width to each column header? Is it impossible too in Qt designer? Those options shown in above picture change whole headers.

Similar Threads

  1. Problem setting items in QTableWidget
    By MartijnKor in forum Newbie
    Replies: 2
    Last Post: 12th July 2016, 20:00
  2. setColumnWidth problem
    By Midek in forum Newbie
    Replies: 5
    Last Post: 26th October 2010, 15:05
  3. qgridlayout setting in qt designer
    By hottdogg in forum Qt Tools
    Replies: 1
    Last Post: 4th October 2009, 08:58
  4. QTableView ::setColumnWidth not working?
    By killerwookie99 in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2008, 18:14
  5. Setting behaviour in designer
    By Morea in forum Qt Tools
    Replies: 3
    Last Post: 19th March 2006, 16:33

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.