maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Are there any N900 PyQt examples? (https://talk.maemo.org/showthread.php?t=41916)

LadyBug 2010-01-23 08:47

Are there any N900 PyQt examples?
 
I've been hunting for any N900 PyQt widget and application examples, but so far I haven't found a lot. Most of the examples in the docs assume the use of C/C++.

I've got a smal application working in Eric4 / Qt Designer, but I'd like to make it a N900 widget.

Any help appreciated.

omeriko9 2010-01-28 21:54

Re: Are there any N900 PyQt examples?
 
I second that request... couldnīt find any PyQt4 code examples on google for n900 desktop widget...

attila77 2010-02-01 01:44

Re: Are there any N900 PyQt examples?
 
If you show me a little example helloworld widget in Qt/C++, I can try and make a PyQt widget out of it.

danielwilms 2010-02-01 08:40

Re: Are there any N900 PyQt examples?
 
Quote:

Originally Posted by attila77 (Post 504499)
If you show me a little example helloworld widget in Qt/C++, I can try and make a PyQt widget out of it.

Have a look here.

Daniel

attila77 2010-02-01 15:00

Re: Are there any N900 PyQt examples?
 
Whoa, that's no moon... It looks more like an X function handling example than Qt :) Not sure how to handle all that except through ctypes, and if I go there, it will be ugly as hell (what's the point in writing Python code if it looks uglier than the C original ? :) )

irooniam 2010-02-03 02:06

Re: Are there any N900 PyQt examples?
 
Hello,

this might help you a bit.

I use qt designer and then I use pyside's tool to convert the xx.ui to xx.py to include

pyside-uic -d xx.ui -o xx.py

my main body of code (main.py) looks like this:
from PySide import QtCore, QtGui
import sys
import ui


class starter(QtGui.QMainWindow):
def __init__(self, parent=None):
super(starter, self).__init__(parent)
self.ui = ui.Ui_Frame()
self.ui.setupUi(self)

if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
starter = starter()
starter.show()
sys.exit(app.exec_())


Please note that this example, used a frame, so if you start with a widget your line will look something like:
ui.Ui_Widget()

Hope that helps.

lostinmirkwood 2010-02-03 20:57

Re: Are there any N900 PyQt examples?
 
FYI, "PyQt Documentation and Examples" just got released to Extras. That might be helpful

http://maemo.org/packages/package_in...oc/4.7-maemo2/

attila77 2010-02-03 21:55

Re: Are there any N900 PyQt examples?
 
Hey, that's a familiar package :) But jokes aside, the discussion was about desktop widgets, and that examples packages falls short in that regard (as they are sadly not really supported in Qt4.5 without some workarounds/quite a bit of boilerplate code). Apparently Qt4.6 will be better in that regard (this is not really about PyQt, PyQt will use whatever the underlying Qt supports).

irooniam 2010-02-03 23:14

Re: Are there any N900 PyQt examples?
 
Yeah after I re-read it I realized you're asking the same thing I was in another thread:

http://talk.maemo.org/showthread.php?t=43177

Daniel said he's hoping to have an example up soon.

lostinmirkwood 2010-02-05 18:27

Re: Are there any N900 PyQt examples?
 
Quote:

Hey, that's a familiar package
oops. Had I know you were the maintainer I'd wouldn't have mentioned it. I have found it quite interesting though, as on device code examples.


All times are GMT. The time now is 10:36.

vBulletin® Version 3.8.8