Results 1 to 3 of 3

Thread: Signal from inside a delegate

  1. #1
    Join Date
    Dec 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Signal from inside a delegate

    Hello,

    im emitting a signal from inside a delegate that overrides the paint function, but from outiside i cant manage to connect the signal because its not recognized...

    http://pastie.org/741017

    This is a part of the code, from different files... im using setItemDelegate in another delegate (VListView) so I dont know exactly how it works... do i need to create a VListView::setItemDelegate to make it work? What am i missing?

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Signal from inside a delegate

    Aren't you confusing QAbstractItemViews with QAbstractItemDelegates here? An item view does not propagate a signal from an item delegate and vice versa unless explicitly coded to do so.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

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

    Default Re: Signal from inside a delegate

    Emitting a signal from the delegate's paint() routine is a bad idea. Even if you do connect the signal, you will have it emitted in random moments of time and slowing down your application. I suggest you connected to one of the QItemSelectionModel signals instead. And next time please attach code to your post instead of using 3rd party sites.
    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. emit a signal from inside a callback routine
    By franco.amato in forum Qt Programming
    Replies: 20
    Last Post: 21st January 2010, 18:05
  2. Highlighted text/image inside delegate
    By hailflex in forum Newbie
    Replies: 0
    Last Post: 11th December 2009, 15:36
  3. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  4. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  5. QMovie from inside a custom item delegate
    By Crazy_Hopper in forum Qt Programming
    Replies: 3
    Last Post: 7th May 2008, 15:18

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.