Results 1 to 3 of 3

Thread: Resize Columns when QTableView is full screen and default size

  1. #1
    Join Date
    Nov 2010
    Posts
    100
    Thanks
    38
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Resize Columns when QTableView is full screen and default size

    Hello every one i have a QTableView in which i am displaying some data, I wanted to know how i can resize the Cells in the QTableView when i resize the window to full screen. right now there is white space after four columns. I wanted to resize the column size so that there is no white space seen when i see it in the Full Screen also.
    I tried a few things but it din't work as expected.
    Qt Code:
    1. tableView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    2.  
    3. tableView->setColumnWidth(0,100);
    4. tableView->setColumnWidth(1,100);
    5. tableView->setColumnWidth(2,100);
    6. tableView->setColumnWidth(3,100);
    To copy to clipboard, switch view to plain text mode 
    i looked on the forum but din't find much help on this issue.. What should i do to resize the columns when i view full screen.

    Thank you

  2. #2
    Join Date
    Jan 2011
    Posts
    32
    Thanks
    11
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resize Columns when QTableView is full screen and default size

    void QHeaderView::setResizeMode ( int logicalIndex, ResizeMode mode )

  3. #3
    Join Date
    Nov 2010
    Posts
    100
    Thanks
    38
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default Re: Resize Columns when QTableView is full screen and default size

    hello thank you for the help.. i did this and my problem is solved .

    Qt Code:
    1. tableView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    2. tableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
    To copy to clipboard, switch view to plain text mode 

    regards

Similar Threads

  1. Replies: 3
    Last Post: 25th January 2011, 14:36
  2. Replies: 0
    Last Post: 19th January 2011, 04:29
  3. full screen on specified monitor
    By mgb_qt in forum Qt Programming
    Replies: 2
    Last Post: 3rd August 2010, 19:35
  4. Replies: 0
    Last Post: 28th May 2009, 23:38
  5. Don't resize columns - QTableView
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 26th January 2009, 17:59

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.