![]() |
pyqt Menu's - need an example please?
Hi everyone, i have searched everywhere, tried irc and really not getting anywhere.
I'm trying to implement a very simple menu in pyqt (for the n900). It just needs one button that runs a function. IMy code probably looks a bit confused by now as i have tried lots of things... i've got to a point with no errors, but also no menu when i click the title bar. Any help would be greatly appreciated. Code:
self.menubar = QtGui.QMenuBar(MainWindow) |
Re: pyqt Menu's - need an example please?
Note that in Qt4.5 the menu *must* be called "fremantle" to be displayed. Qt4.6 will display them all, but not in a backwards compatible way (they will appear as "fremantle/[optionname]"). Also, I think you want to use setText (objectName is something different) :)
|
Re: pyqt Menu's - need an example please?
Quote:
Not sure if that is what you really need though. That gives you a hildon menu by clicking the title bar of your Qt app. |
Re: pyqt Menu's - need an example please?
thanks krk969, thats in c though :| :|
trying atilla's recommendation with no luck so far... also been trying #create menu fremantle = MainWindow.menuBar().addMenu("File"); act = fremantle.addAction("Update") QtCore.QObject.connect(act, QtCore.SIGNAL("triggered()"), self.updateAll) Nothing seems to work :| |
Re: pyqt Menu's - need an example please?
Code:
#!/usr/bin/python |
Re: pyqt Menu's - need an example please?
In the interest of letting everyone know how stupid i am.........
I was calling a menubar elsewhere in my code.... thus overwriting the menu i was trying to create.... (Massive thanks to everyone in here, + w00t on irc who actually went through my code and found it!!) |
All times are GMT. The time now is 11:52. |
vBulletin® Version 3.8.8