Results 1 to 5 of 5

Thread: QTableWidget Default width of row and column

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    33
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QTableWidget Default width of row and column

    Hi,

    Thanks for reply but i need this

    table->horizontalHeader()->resizeSection(column,10);
    table->verticalHeader()->resizeSection(row,10);

    column and row need to passed only once. I don't want to set again and again

  2. #2
    Join Date
    Jan 2008
    Location
    Davao City, Philippines
    Posts
    77
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    16
    Thanked 4 Times in 4 Posts

    Default Re: QTableWidget Default width of row and column

    Put the code I have posted above into the header (once for each column). No need to do it again and again ...

    But may be this is what you are really looking for:

    Qt Code:
    1. tableWidget->verticalHeader()->setDefaultSectionSize(50);
    2. tableWidget->horizontalHeader()->setDefaultSectionSize(200);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2010
    Posts
    33
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: QTableWidget Default width of row and column

    Hi,

    Thanks It works as I want

Similar Threads

  1. Handle QTableWidget's column width change
    By dorians58 in forum Newbie
    Replies: 0
    Last Post: 28th July 2010, 19:24
  2. Replies: 0
    Last Post: 16th March 2010, 03:54
  3. QTableWidget column width and resizing
    By shooogun in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2008, 22:31
  4. changing column width of QTableWidget
    By juliarg in forum Newbie
    Replies: 4
    Last Post: 22nd March 2007, 15:51
  5. Replies: 6
    Last Post: 13th October 2006, 14:40

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
  •  
Qt is a trademark of The Qt Company.