Results 1 to 8 of 8

Thread: subclassing QHeaderView

  1. #1
    Join Date
    Apr 2006
    Posts
    11
    Thanked 1 Time in 1 Post

    Default subclassing QHeaderView

    Hi,

    i'm trying to rotate header items (text) in my qtablewidget.
    i#m on the way to subclass qheaderview and the paintsection and paintevent methods inside.

    but i don#t understand the meaning of ex. Q_D or other macros inside the cpp file. can anyone explain me this issue.

    thx in advice

    miro

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

    Default Re: subclassing QHeaderView

    J-P Nurmi

  3. #3
    Join Date
    Apr 2006
    Posts
    11
    Thanked 1 Time in 1 Post

    Default Re: subclassing QHeaderView

    thx

    is it posible to subclass it and if yes then how?

  4. #4
    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: subclassing QHeaderView

    Maybe it would be enough to provide an own item delegate for the header view?

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

    Default Re: subclassing QHeaderView

    Quote Originally Posted by wysota
    Maybe it would be enough to provide an own item delegate for the header view?
    This was kind of a surprise to me, but I just yesterday noticed that QHeaderView doesn't use delegates for anything at all.

    Overriding just
    Qt Code:
    1. void QHeaderView::paintSection ( QPainter * painter, const QRect & rect, int logicalIndex ) const [virtual protected]
    To copy to clipboard, switch view to plain text mode 
    might be enough and is most probably the best way to go..
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    swdev (12th June 2014)

  7. #6
    Join Date
    Apr 2006
    Posts
    11
    Thanked 1 Time in 1 Post

    Default Re: subclassing QHeaderView

    thanks.

    i#m now able to rotate the header items. but the size of the gray colored background (behind the header) is still the same. where is this painted?

  8. #7
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: subclassing QHeaderView

    sizzHint method to re-implement ?

  9. #8
    Join Date
    Apr 2006
    Posts
    11
    Thanked 1 Time in 1 Post

    Default Re: subclassing QHeaderView

    already done!

    thanks

Similar Threads

  1. QHeaderView -- diagonal headers?
    By vycke in forum Qt Programming
    Replies: 7
    Last Post: 28th April 2008, 23:54
  2. Replies: 2
    Last Post: 14th August 2007, 15:16
  3. QHeaderView as a banner
    By mclark in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2007, 19:28
  4. Renumbering Row Headers of QHeaderView
    By mclark in forum Newbie
    Replies: 4
    Last Post: 11th September 2006, 15:04
  5. Subclassing QScrollView
    By sumsin in forum Qt Programming
    Replies: 13
    Last Post: 16th March 2006, 14:20

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.