Results 1 to 3 of 3

Thread: QTableWidget : hidding a column ?

  1. #1
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableWidget : hidding a column ?

    Hello,

    I would like to know if it is possible to hide a column of a QTableWidget, without using the QTableView ?

    Actually I use a function that add rows and data to my QTableWidget, so I could disable or hide the cells... But setEnable(bool) and setVisible(bool) aren't defined for QtableWidgetItem.

    Have you got an idea ?



    PS : In fact I need to hide the data of the column, because it contains passwords... But I can't replace the data, cause the user must be able to save it. So I have to hide it, or to change the font with "****"; but I didn't find how to do it

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTableWidget : hidding a column ?

    Quote Originally Posted by Nyphel View Post
    I would like to know if it is possible to hide a column of a QTableWidget, without using the QTableView ?
    QTableWidget is a QTableView. Use QTableView::setColumnHidden().
    J-P Nurmi

  3. The following 6 users say thank you to jpn for this useful post:

    frankiefrank (8th February 2011), jerobarraco (23rd October 2012), Nyphel (2nd April 2007), Olivia (28th April 2011), rawfool (21st June 2013), tpf80 (18th June 2007)

  4. #3
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget : hidding a column ?

    Ups... Thanks JPN

Similar Threads

  1. QTableWidget stretch a column other than the last one
    By roleroz in forum Qt Programming
    Replies: 6
    Last Post: 4th February 2015, 07:35
  2. QTableWidget first column always visible
    By topino in forum Qt Programming
    Replies: 13
    Last Post: 30th December 2014, 09:06
  3. changing column width of QTableWidget
    By juliarg in forum Newbie
    Replies: 4
    Last Post: 22nd March 2007, 16:51
  4. Replies: 6
    Last Post: 13th October 2006, 15:40
  5. QTableWidget column and row sizes
    By Arthur in forum Qt Programming
    Replies: 4
    Last Post: 27th January 2006, 12:03

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.