Reply
Thread Tools
Posts: 20 | Thanked: 13 times | Joined on Jan 2010 @ Finland
#1
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's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#2
I second that request... couldnīt find any PyQt4 code examples on google for n900 desktop widget...

Last edited by omeriko9; 2010-01-28 at 21:56.
 
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#3
If you show me a little example helloworld widget in Qt/C++, I can try and make a PyQt widget out of it.
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#4
Originally Posted by attila77 View Post
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
 

The Following User Says Thank You to danielwilms For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#5
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 ? )
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 13 | Thanked: 2 times | Joined on Sep 2009
#6
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's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#7
FYI, "PyQt Documentation and Examples" just got released to Extras. That might be helpful

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

The Following User Says Thank You to lostinmirkwood For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#8
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).
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 
Posts: 13 | Thanked: 2 times | Joined on Sep 2009
#9
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's Avatar
Posts: 128 | Thanked: 232 times | Joined on Sep 2009 @ New Jersey, USA
#10
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.
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:55.