Results 1 to 7 of 7

Thread: QTableWidget stretch a column other than the last one

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Posts
    15
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up Re: QTableWidget stretch a column other than the last one

    Fixed

    Qt Code:
    1. colorizerTable = new QTableWidget(0, 3, colorizerWidget);
    2. colorizerTable->setSortingEnabled(false);
    3. QHeaderView *headerView = new QHeaderView(Qt::Horizontal, colorizerTable);
    4. colorizerTable->setHorizontalHeader(headerView);
    5. headerView->setResizeMode(0, QHeaderView::Stretch);
    6. headerView->setResizeMode(1, QHeaderView::Interactive);
    7. headerView->resizeSection(1, 40);
    8. headerView->hideSection(2);
    To copy to clipboard, switch view to plain text mode 

    Just needed to set the headerView to the table before setting the headerView parameters

  2. The following 2 users say thank you to roleroz for this useful post:

    giowck (18th July 2010), swdev (22nd May 2014)

Similar Threads

  1. QTableWidget Update - slow
    By DPinLV in forum Qt Programming
    Replies: 16
    Last Post: 18th August 2006, 21:09
  2. Replies: 6
    Last Post: 5th March 2006, 21:05
  3. QTableWidget column and row sizes
    By Arthur in forum Qt Programming
    Replies: 4
    Last Post: 27th January 2006, 11:03
  4. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 15:51

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.