GUI for multiplatform multimedia project

2010-01-06 Thread trzewiczek
Hi everyone,

I posted that question on a python-forum, but got answer, so I ask here. 

I'm working on an artistic project and I'm looking for the best
cross-platform GUI solution. The problem is that it's gonna be a tool that
will have to be double-click installable/runnable and pre-installation of
any libraries for end-users is very much like an evil. It really has to be
double-click tool 

My first thought was PyQt, because it's a real framework with a lot of
stuff inside (including Phonon) and I know some cross-platform media
software written in C++ QT (like VLC). But on the other hand I've heard
that it's not that easy to make it "double-clicky" multi-platform. Is that
true? 

Another thing that matters for me is ease of integration with libraries
like OpenCV. 

I will be VERY thankful for any help. I'm SO tired googling the problem
(it's like weeks now!!)

Best from Poland, 
trzewiczek
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Linking Python to multiple qt forms

2010-01-11 Thread trzewiczek

On 01/11/2010 11:57 PM, Zabin wrote:

Hey!

I am new to PyQt programming and am trying to activate a secondary qt
form from a primary form. I am unsure as to how this will work as i am
using pyuic4 to convert .ui file to .py and then importing it by:

from SimLCM_GUI import Ui_main

I am unsure as to how the self.uicommands will function if there
are two such .ui files.

Thanks in advance for any advice!

Cheers
Zabin
   
The easiest way for me was to create three classes - two for each form 
created in QDesigner and one that holds them as objects. If you want to 
switch from one to another you can emit a SIGNAL to the form's SLOT 
setVisible(bool) to hide it  and another to the other to show it. My 
code looks sth like that:


#
# imports

from options_ui import Ui_options
from main_ui import Ui_main


#
# class for the first ui form

class OptionsPanel(QtGui.QWidget):

def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)

self.ui = Ui_options()
self.ui.setupUi(self)


#
# class for the second ui form

class MainPanel(QtGui.QWidget):

def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)

self.ui = Ui_main()
self.ui.setupUi(self)


#
# holder class for the panels

class MyApp(QtGui.QWidget):

def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)

self.setWindowTitle("My App")

self.options_panel = OptionsPanel(self)
self.main_panel = MainPanel(self)

QtCore.QObject.connect(self, QtCore.SIGNAL("main(bool)"), 
self.main_panel, QtCore.SLOT("setVisible(bool)"))
QtCore.QObject.connect(self, QtCore.SIGNAL("options(bool)"), 
self.options_panel, QtCore.SLOT("setVisible(bool)"))


self.showMain()


#
# functions that toggle the views

def showOptions(self):
self.emit(QtCore.SIGNAL("main(bool)"), False)
self.emit(QtCore.SIGNAL("options(bool)"), True)

def showMain(self):
self.emit(QtCore.SIGNAL("options(bool)"), False)
self.emit(QtCore.SIGNAL("main(bool)"), True)


As I said - that works for me. If there's a better way, being a new to 
PyQt4 I'm looking for it as well!


Best from Poland,
trzewiczek
--
http://mail.python.org/mailman/listinfo/python-list


Re: Code Generator written in python

2010-01-14 Thread trzewiczek

On 01/13/2010 05:09 PM, Arnaud Delobelle wrote:

nyoka  writes:

   

Can someone help me with sample python code for a code generator
 

Sure, here are some example of self-evaluating python objects, i.e. for each v
below,

v == eval(v)

I'm quite proud of the last one.

v = (lambda x:x%('"''""'+x+'"''""'))("""(lambda 
x:x%%('"''""'+x+'"''""'))(%s)""")

v = (lambda x:x%('r\"'+x+'\"'))(r"(lambda x:x%%('r\"'+x+'\"'))(%s)")

v = (lambda x:x%`x`)('(lambda x:x%%`x`)(%s)')

v = (lambda x: x+"("+`x`+")")('(lambda x: x+"("+`x`+")")')

v = "\"%s\" %% ((r\"%s\",)*2)" % ((r"\"%s\" %% ((r\"%s\",)*2)",)*2)

:)

   
If you're proud of the last one, consider moving to Perl. Python is - as 
I heard - about elegance and readability of code...

--
http://mail.python.org/mailman/listinfo/python-list