Results 1 to 4 of 4

Thread: Custom QHeaderView

  1. #1
    Join Date
    May 2008
    Posts
    12
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Custom QHeaderView

    Hi All,

    I want to create a custom QHeaderView for my QTreeView, It should hide the column exactly it does in VisualStudio (Attached Image). User click at down arrow provided at right most portion of Header and a context menu containing all column items should popup and user can toggle it's view (hide/show) by selecting and deselecting the item in the menu.

    I am clueless how to start this, I will highly appreciate any help or example.

    Thanks in advance
    Attached Images Attached Images

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

    Default Re: Custom QHeaderView

    In the image you provided the "header" is not really a header, it is a toolbar. The table is headerless and there is a toolbar over it. If you place a toolbar over a table and make sure sizes of the two widgets are synced, you'll get the same behaviour.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2012
    Location
    Brasil
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Custom QHeaderView

    Hi,

    I have the same problem as y.s.bisht, but with some differences:
    I use a QTreeWidget and I want each column header of this TreeWidget showing a title and besides it a ToolButton. Do I need a delegate class??

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

    Default Re: Custom QHeaderView

    QHeaderView doesn't use delegates.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    aisabellafontes (7th March 2012)

Similar Threads

  1. custom QHeaderView - Excel AutoFilter like
    By ttvo in forum Qt Programming
    Replies: 0
    Last Post: 3rd October 2010, 16:50
  2. Replies: 1
    Last Post: 8th September 2010, 21:38
  3. QHeaderView
    By gyre in forum Qt Tools
    Replies: 1
    Last Post: 25th September 2007, 16:35
  4. QTableView with custom QHeaderView
    By xbase in forum Qt Programming
    Replies: 6
    Last Post: 14th September 2007, 13:21
  5. Custom QHeaderView in Qt 4.1.1
    By Tair in forum Qt Programming
    Replies: 2
    Last Post: 11th July 2006, 09:44

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.