[KDE Dot News]
 faq
 flatforty
 contribute
 subscribe
 configure
 search
 rdf

 main
 parent
 thread


Re: KDE & Companies: Ask Trolltech Anything
by Justin on Sunday 08/Jul/2001, @01:49
I think QEvent is for window-system events only (like paint, mouse, keystroke, etc), while signal/slot is for anything under the sun.
  Related Links
 ·   Articles on Feature
 ·   Also by Justin
 ·   Contact author

Thread Threshold:

The Fine Print: The following comments are owned by whomever posted them.
( Reply )

Re: KDE & Companies: Ask Trolltech Anything
by Amir Michail on Sunday 08/Jul/2001, @02:40
Yes, that's true, but why have two completely different mechanisms? Why not have a more general mechanism that can support all kinds of tasks?
[ Reply To This | View ]
  • Re: KDE & Companies: Ask Trolltech Anything
    by not me on Sunday 08/Jul/2001, @03:46
    I'd say that signals/slots are probably slower than QEvent by a small amount, but every little bit counts when you're processing clicks and keypresses at the toolkit level.
    [ Reply To This | View ]
  • Re: KDE & Companies: Ask Trolltech Anything
    by Guillaume Laurent on Sunday 08/Jul/2001, @06:45
    One obvious answer is performance reasons, the other is simply that event handling and signals are actually quite different in purpose.

    Signals are used to "communicate" between widgets, typically when a widget needs to report about a state change. Events are things which the widget may want to handle itself.

    Try figuring out how it would be if QEvents were replaced by signals or if signals were replaced by QEvent. It just won't work.
    [ Reply To This | View ]
    • Re: KDE & Companies: Ask Trolltech Anything
      by Justin on Sunday 08/Jul/2001, @18:30
      Well, signals/slots don't have to be used for widgets. That's the difference I pointed out above.

      Take, for example, my project called Psi (it's a Jabber client. see: http://www.affinix.com/~justin/programs/psi/). The backend classes to handle the XML, networking, and communication to the main program all use signal/slots. There is no widget in sight. In fact, the first incarnations of Psi were all console based (requiring Qt of course, because of the signal/slots and QSocket/QXml/QString,etc). QEvents are window system notifications. Signals/slots are a really cool way for your classes to interact within your program.

      -Justin
      [ Reply To This | View ]

 
The Fine Print: The previous comments are owned by whomever posted them.
( Reply )

  "I switch between vi and xemacs quite a lot. I'm happy with both." -- Simon Hausmann
KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
[ home | post article | flat forty | subscribe | search | rdf ]