Hi guys,
Last week I spent some time working on a idea I had some time ago,
this is a way to describe QML scenes without QML :D. In other words is
a new way to describe scenes only using Python.
With that you remove the necessity of use QML code in your python programs.
My idea is in early stage then I would like to discuss with you is,
which is the best way to describe scenes in python?. I'm not a heavy
python user, then I'm not familiar with all python features, because
of that I want your opinions.
My first try is something like that:
class Rectangle1(Rectangle):
anchors = Anchor(centerIn = parent)
width = 800
height = 480
color = 'red'
class Rectangle2(Rectangle):
anchors = Anchor(fill = parent)
color = 'white'
class Rectangle3(Rectangle):
anchors = Anchor(centerIn = parent)
width = 200
height = 200
color = 'black'
class Image1(Image):
anchors = Anchor(centerIn = parent)
source = 'logo.png'
width = 64
height = 64
class MouseArea2(MouseArea):
anchors = Anchor(fill = parent)
def onClick(self):
print "show"
This describe a scene with 3 rectangle, 1 image and a mouse area, this
is very similar to QML code I only translate the QML code to python,
but I do not know if there is some a best pythonic way to do that.
What do you think about this way to describe scenes?
Do you have any suggestions to make this more pythonic?
The initial code, it can be found on my github repostiry[1], this is
very early to report bugs or even try use that, first I need to figure
out the best way to describe the scenes and then I will work on new
features and stability.
I hope someone can give some feedback and help me to develop the idea.
[1] https://github.com/renatofilho/pysideQML
Thanks
--
Renato Araujo Oliveira Filho
Instituto Nokia de Tecnologia - INdT
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside