[PyQt] future of (py)qt desktop

David Boddie david at boddie.org.uk
Wed Jan 6 16:40:39 GMT 2016


On Wed Jan 6 15:29:28 GMT 2016, Dietmar Schwertberger wrote:

> It would help a lot if it would be possible to just define the basic GUI 
> in QML, but connect events, fill the widgets etc. from Python without 
> all the JavaScript mess.
> E.g.
> self.GUI = qt.load("GUI.qml")
> self.GUI.windows["Main"].widgets["Play"].connect(self.OnPlay)
> self.GUI.windows["Main"].widgets["list"].fill( ["Title 1", "Title 2"] ) 
> # for a short list, otherwise use MVC
> 
> def OnPlay(self, event):
>      track_index = self.GUI.forms["Main"].widgets["list"].getIndex()

While there isn't a C++ API that can do that, there's unlikely to be one for
Python. I think there was some discussion on the Qt developer blogs about the
need for such an API and there may even be some tickets in the bug tracker
about it. It certainly wasn't something that seemed to be a priority.

> Currently, Qt Quick is a no-go for me. I had a close look and I don't 
> like it...

The original idea was to use it to define GUIs declaratively, initially using
an XML-based syntax but quickly switching to a JSON-like one. It became clear
after a very small amount of prototyping that developers needed to be able to
insert Javascript expressions in QML structures to make more than the
simplest GUIs.

From there it snowballed in complexity to the point where some of the older
Qt developers should have recognised that they had another Qt Designer .ui.h
situation on their hands. Really, it needed a rethink and another iteration.

David


More information about the PyQt mailing list