Results 1 to 2 of 2

Thread: How can i set a delegate on header in table

  1. #1
    Join Date
    Mar 2006
    Location
    Vadodara, Gujarat, India
    Posts
    65
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How can i set a delegate on header in table

    Hi all,
    i want to set a combo delegate on header. i used

    Qt Code:
    1. horizontalHeader()->setItemDelegate(new ComboDelegate)
    To copy to clipboard, switch view to plain text mode 

    but i couldn't get it on header.

    how can i set it ?
    Last edited by ankurjain; 16th May 2006 at 12:12.
    Do what u r afraid to do, and the death of fear is sure.

  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: How can i set a delegate on header in table

    QHeaderView doesn't seem to use delegates.

    And unfortunately it seems like QHeaderView doesn't lay it's index widgets correctly:
    Qt Code:
    1. QModelIndex idx = horizontalHeader()->model()->index(0, column);
    2. horizontalHeader()->setIndexWidget(idx, someWidget);
    To copy to clipboard, switch view to plain text mode 
    The widget will be there, but it's position is (0,0) and size (0,0). So you will have to resize and move it manually.

    This could be, in my opinion, reported to Trolltech..
    J-P Nurmi

Similar Threads

  1. Replies: 3
    Last Post: 20th January 2011, 13:24
  2. Editable table header
    By bbarran in forum Qt Programming
    Replies: 4
    Last Post: 9th December 2010, 10:26
  3. Table header section click problem
    By Khal Drogo in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2008, 22:31
  4. How to prevent table header from font change.
    By kenny_isles in forum Qt Tools
    Replies: 1
    Last Post: 14th February 2007, 19:01
  5. Editable table header
    By cmaxb in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2006, 12:12

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.