Results 1 to 4 of 4

Thread: QTreeView Delegate

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QTreeView Delegate

    Hi,

    I've created an own model that is displayed on a QTreeView. Now I want to use a delegate to let the data be modified.
    The application shows the tree perfectly until I set the delegate to the view. Then nothing is showed(no items into the tree).

    To create my own delegate I used the "spinboxdelegate" delegate class with some modeifications. I've inserted breakpoints on all functions on the delegate class but they are never called so I don't know where is the problem.

    Anoyone had the same problem?

    Thanks,
    Òscar Llarch i Galán

  2. #2
    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: QTreeView Delegate

    Can we see some code ? Delegate code and how it is being set ?

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTreeView Delegate

    once i forgot to put the "const" at the end of virtual functions... they were never called.. but in a different compiler they were working...

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView Delegate

    Hi,

    Sorry, I did a mistake. I create the delegate in the mainWindow constructor to try it but I forget to create it as pointer instead of variable. So when the constructor call is finish, the delegate is deleted.

    Thanks,
    Òscar Llarch i Galán

Similar Threads

  1. row height with QTreeView and delegates
    By Philipp in forum Qt Programming
    Replies: 7
    Last Post: 11th November 2008, 10:40
  2. Delegate for a certain item?
    By somebody in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2008, 22:55
  3. QItemDelegate, QTreeView and scrollbars
    By SiLiZiUMM in forum Qt Programming
    Replies: 11
    Last Post: 6th May 2008, 17:23
  4. No delegate for 1 column in QTreeView
    By mace in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2007, 10:55
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.