Results 1 to 2 of 2

Thread: QTableWidget, header behavior

  1. #1
    Join Date
    Oct 2006
    Location
    Raleigh, NC
    Posts
    11
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QTableWidget, header behavior

    Hi,

    I'm trying to port a Qt3 app to Qt4. I would like the QTableWidget to look like Q3Table. By default QTableWidget will select a column header(make it look darker) when you select a row. I would like to disable this behavior so the header look doesn't change when you select a row.

    Thanks
    Hua-Ying

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableWidget, header behavior

    There are two possibilities. Either modify the palette of the header (you can access the header through horizontalHeader() or verticalHeader()) and if this doesn't work, simply subclass QHeaderView and reimplement its painting so that it ignores the selected state for sections. You'll have to subclass QTableWidget itself too so that you can assign the new header instead of the original one.

Similar Threads

  1. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 19:46
  2. Replies: 3
    Last Post: 29th August 2006, 16:07
  3. How to delete header on QTableWidget
    By jlbrd in forum Qt Programming
    Replies: 2
    Last Post: 18th July 2006, 22:00
  4. Two-row header for QTreeWidget
    By wetzel in forum Qt Programming
    Replies: 1
    Last Post: 27th May 2006, 13:26
  5. Replies: 6
    Last Post: 5th March 2006, 22:05

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.