Results 1 to 2 of 2

Thread: QHeaderView with QMenu

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QHeaderView with QMenu

    I have QTableView who's model is a QSqlTableModel. My goal is to have a sort and filter option to the user. As a GUI to this I would like to make QHeaderView to have buttons in them so i can assign some QMenu to that button. See attachment

    I can implement the sorting and filtering part by manipulating the SQL statements. I just need to put a MS Excel touch to it.

    How can I add button to QHeaderView?

    baray98
    Attached Images Attached Images
    Last edited by wysota; 11th June 2010 at 17:06.

  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: QHeaderView with QMenu

    Adding real buttons is a tricky thing to do because you have to synchronize them all the time. It is easier to use QStyle API to draw an artificial button on each section of the header and reimplement mouse events to provide support for activating the "buttons".
    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.


Similar Threads

  1. QHeaderView
    By waynew in forum Qt Programming
    Replies: 2
    Last Post: 25th December 2009, 20:42
  2. how to set up a QHeaderView editable?
    By iguanna in forum Qt Programming
    Replies: 3
    Last Post: 24th March 2008, 14:37
  3. QHeaderView
    By gyre in forum Qt Tools
    Replies: 1
    Last Post: 25th September 2007, 16:35
  4. QHeaderView as a banner
    By mclark in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2007, 19:28
  5. QMenu in QHeaderView
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 15th July 2006, 14:58

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.