[Qt-qml] Python and QML
Jason H
scorp1us at yahoo.com
Tue Sep 14 23:04:35 CEST 2010
What I would do is ditch (or adapt) your python stuff and use signals/slots in
the declarative engine. You could have it control the motors directly. Or, if
you have too much invested, use proxy objects to receive the signal, then have
it send out a socket or whatever, in a means your python script can pick up.
See:
QDeclarativeComponent <- control with one, or poxy the UI events hrough one to
the python code.
Calling C++ methods from QML
How do you get the data into python for motor control? command line params?
----- Original Message ----
From: Robert Garrett <rob.garrett at blacktrace.com>
To: Jason H <scorp1us at yahoo.com>
Cc: Qt-qml at trolltech.com
Sent: Tue, September 14, 2010 4:55:37 PM
Subject: Re: [Qt-qml] Python and QML
My application will allow a user to control some hardware (for example
some motors). I have some code written in python that handles the
comms and other aspects of hardware control, and there's a well
defined interface for controlling them and reading back the status
etc. I've also now got a QML interface for displaying status screens
and allowing a user to move the motors.
What I need is some way of joining the 2 things up, so that the
current motor status is displayed in the UI, and when buttons are
pressed these events are sent through to the hardware control.
I was under the impression that something like PySide is a python
wrapper for the Qt modules and would allow me to create a
QDeclarativeView for presenting the UI, and then some signals and
slots for connecting things up. Perhaps I'm going about this the
wrong way?
Rob
On 14 September 2010 17:58, Jason H <scorp1us at yahoo.com> wrote:
> I don't think there are any implementations of a python declarative engine.
>Even
> so, it would only be wrapped. PyQt won't do it until 4.7 is released, but it
> should appear in the snapshots days after.
>
> With the models and source, what does the back-end implementation matter? it
> should me XML/images/video.etc/ served by a webserver.
>
>
>
>
>
>
> ----- Original Message ----
> From: Robert Garrett <rob.garrett at blacktrace.com>
> To: Qt-qml at trolltech.com
> Sent: Tue, September 14, 2010 12:40:13 PM
> Subject: [Qt-qml] Python and QML
>
> Hi all,
> I'm not sure if this is the correct place for my query, but if not
> hopefully someone could point me to the right place.
>
> I'm building an embedded application using QML for the front-end and
> python for the back-end. I'm not sure how to join these bits
> together, though.
>
> Can anyone give me some examples/demonstration code for hooking this
> into Python? I've seen the PySide project, which looks to do what I
> need, but I'm new to Qt and the docs at PySide don't have much
> information on the QtDeclarative side of things.
>
> At the moment something very simple would be helpful - a python script
> that creates the window using a qml file and then some python code to
> update a text box in the interface. And a button in the interface
> that causes a function in the python code to be run. I'm sure this
> should be a simple signal/slot thing, but I've struggled to get the
> syntax working. From there I should be able to figure most of what I
> need.
>
> Thanks,
> Rob
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
>
>
>
>
--
Robert Garrett
Software Engineer
The Blacktrace Group
The Dolomite Centre Ltd,
Unit 1, Anglian Business Park,
Royston, SG8 5TW, UK
Phone: +44 1763 242491
Fax: +44 1763 246125
************************************************************
This message is intended only for the use of the individual or entity
to whom it is addressed. It may contain confidential or legally
privileged information. If you are not the intended recipient you are
hereby notified that any disclosure, copying, distribution of this
information is strictly prohibited and may be unlawful. If you have
received this communication in error, please notify us immediately by
responding to this email and then delete it from your system. Dolomite
is neither liable for the proper and complete transmission of the
information contained in this communication nor for any delay in its
receipt.
More information about the Qt-qml
mailing list