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

 main
 parent
 thread


Re: Callbacks?
by Pau Garcia i Quiles on Monday 10/Jul/2006, @15:22
It would be possible to make the event trigger a signal in the backend and call the slots in the script, but it might get bit tricky.

For instance, here's what I'm doing in Korundum/QtRuby to know when a KPresenter presentation has finished:
factory = KDE::LibLoader.self().factory("libkpresenterpart")
@kpresenter = factory.create(w, nil, "KParts::ReadOnlyPart")
@kpresenter.openURL(KDE::URL.new(file))
connect( @kpresenter.widget().children[0], SIGNAL('presentationFinished()'), self, SIGNAL('itemFinished()') )

Look at that: @kpresenter.widget().children[0]. Thanks to Qt introspection I can get to the presentationFinished() signal, but it's quite contrived. It works flawlessly, though.

If the plugin just displays contents and needs no interactivity, another possibility is to use the winId trick: the backend would be an empty QWidget and we then tell the plugin you developed with Kross/QtRuby/PyQt/whatever to display its contents in the window with the winId of the aforementioned QWidget. It works but you get no events, therefore is a very limited approach.
  Related Links
 ·   Articles on Interviews
 ·   Also by Pau Garcia i Quiles
 ·   Contact author

Thread Threshold:

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

  "There are some gaps in my recollection of the past, I always assumed that was sleep." -- Rob Kaper
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 ]