Results 1 to 5 of 5

Thread: Editable table header

  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Editable table header

    I'm using a subclass of QAbstractTableModel to help edit some table information. Editing the contents of the table by overriding flags() seems fine but I can't edit the horizontal table header (ie rename the columns). What's the trick for doing this?

  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: Editable table header

    Quote Originally Posted by bbarran View Post
    I'm using a subclass of QAbstractTableModel to help edit some table information. Editing the contents of the table by overriding flags() seems fine but I can't edit the horizontal table header (ie rename the columns). What's the trick for doing this?
    Unfortunately there is no straightforward trick to do this. One needs both custom header view and item delegate to achieve editable headers. I have attached an example how I did it. Comments are more than welcome.
    Attached Files Attached Files
    J-P Nurmi

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

    bbarran (17th July 2007)

  4. #3
    Join Date
    Jun 2007
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Editable table header

    Thanks for the example jpn. I've worked around it already and now have experience implementing custom delegates so I'll think I'll go back and do something similar to you.

  5. #4
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Editable table header

    Any chance of posting the archive back or copy-pasting the code?

    The archive seems corrupt...

    Regards,
    Davor

  6. #5
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Editable table header

    I will be very thankful if somebody provide an example with editable table header.

    Thanks

Similar Threads

  1. How to prevent table header from font change.
    By kenny_isles in forum Qt Tools
    Replies: 1
    Last Post: 14th February 2007, 19:01
  2. Showing Icon in vertical header of a table
    By vishal.chauhan in forum Qt Programming
    Replies: 7
    Last Post: 15th January 2007, 10:44
  3. Editable table header
    By cmaxb in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2006, 12:12
  4. make each row of table widget not editable??
    By darpan in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2006, 10:22
  5. creating table plugin
    By mgurbuz in forum Qt Programming
    Replies: 3
    Last Post: 28th April 2006, 13:50

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.