Results 1 to 5 of 5

Thread: How to customize horizontal header (diagonal header view)

  1. #1
    Join Date
    Sep 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question How to customize horizontal header (diagonal header view)

    I have a requirement in my project viz. the horizontal header data has to be displayed diagonally. Can any one please let me know, how to do this customization?

    What I tried was,

    Subclassed the QHeaderView and reimplementing the paintSection.
    I can draw skewed / angled lines. But there are no grippers for that line to move the header. How to acheive this?

    I could not place the text properly in each header column. How do I acheive this?

    Can any one help me with a sample code for this?
    Attached Images Attached Images

  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: How to customize horizontal header (diagonal header view)

    You will probably need to handle all the events yourself - mainly mouse events.

  3. #3
    Join Date
    Sep 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to customize horizontal header (diagonal header view)

    Quote Originally Posted by wysota View Post
    You will probably need to handle all the events yourself - mainly mouse events.
    Somehow I could acheive the angled lines in the horizontal header. But when I move the mouse over the header, the angled lines are getting wiped off and it is not happening for the text in the header section. How should I fix this? What we need to handle in the mouse move events? Can I have a example or some snippet of code?

    And how to make the horizontal header sections, clickable? (The vertical header sections are behaving like push buttons and it is not happening for the customized Horizontal header view). How to acheive this?

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to customize horizontal header (diagonal header view)

    Doesnt QHeaderView::setClickable work for u ?

  5. #5
    Join Date
    Sep 2008
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Post Re: How to customize horizontal header (diagonal header view)

    No set clickable didn't work.

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.