I have a small PyQt application and would like to combine it with Wamp /
How would I do this?
Does anybody have a very simple example?
The 'simple example I imagine would be a QT widget with:
a) one button: if pressed sending a publish event
b) one button if pressed sending a call
c) one label being updated via i subscribed signal
d) one piece of code, that updates a label and returns a value to crossbar
(registered RPC call)
My ideas so far:
Up to my understanding i MUST start the PyQT event loop in the main thread,
so I had to start the twisted loop of a crossbar client in a secondary
a) not sure how to do this from a qt thread which is NOT the twisted thread.
in the worst case I could add a web service publish url to the crossbar and
b) same as a)?
c) subscribe from the twisted thread and send a signal to the QT thread *or
would there be better)
d) not sure how to do this
Can this cause any problems?
Any ideas suggestions?
Any pitfalls / special considerations?
Did anybody combine already PYQt and a crossbar client (or even the crossbar
We have several PyQt + Autobahn/Twisted clients at work. Threading is
not necessary. What we do is make use of qt4reactor , a bridge that
makes it possible to run the event loops of Qt and Twisted in tandem.
I don't have minimal example like you describe ready, and I can't
really share the code of the clients we have at work. But if I find
time I'll try to make such an example.
In the meantime, this is a very rough recipe:
1) Create your QApplication object.
2) Create your Autobahn Application object.
3) Install the Qt Twisted reactor with qt4reactor.install().
4) Run your application with app.run(url="your router URL", realm=u"your realm")
You should not call QApplication.exec(..), it will be done for you by
when the reactor starts.
It should be possible to use with the ApplicationSession API as well,
but the simplified Application API is what we're using at the moment.
Here's an example snippet of how we make an async RPC call inside a
slot connected to a Qt button click:
self.statusBar().showMessage('Preparing for acquisition')
num_frames=500, frame_rate=5, binning=1)
Hope you have enough info to get going. But I'll see if I can make a
minimal working example when I have time.
2015-10-25 22:53 GMT+01:00 Gelonida Gel <gelo...@gmail.com>:
thanks in advance for your comments.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an
email to crossbario+...@googlegroups.com.
To post to this group, send email to cross...@googlegroups.com.
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.