Results 1 to 2 of 2

Thread: Which of the two ways of emitting a signal from a derived class is better?

  1. #1
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Which of the two ways of emitting a signal from a derived class is better?

    Which of the following two ways of emitting a signal from my class which inherits from some class with signals is better and why?

    1. Emitting my signal from within overridden method of a base class like QAbstractState:nEntry().

    2. Creating handler for base class' signal like QAbstractState::entered(), connecting the signal with the handler and emitting my signal from within this handler.

  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: Which of the two ways of emitting a signal from a derived class is better?

    It doesn't matter. The second solution though enables someone to disconnect the signal if (s)he wants to. This might be both a good or a bad thing
    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. pthread instead QThread
    By brevleq in forum Qt Programming
    Replies: 8
    Last Post: 23rd December 2008, 07:16
  2. Connection of custon signals/slots
    By brevleq in forum Qt Programming
    Replies: 2
    Last Post: 23rd December 2008, 07:04
  3. Replies: 12
    Last Post: 18th September 2008, 15:04
  4. send own class reference throught signal
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 10th January 2008, 21:55
  5. How to use Signal through direct connection
    By santosh.kumar in forum Qt Programming
    Replies: 1
    Last Post: 14th December 2007, 07:07

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.