python - PySide MainWindow doesn't create Menu Bar -


i'm trying create menubar on mainwindow widget, after writing code found on internet, nothing seems happen, menu bar isn't created, though no error message displayed.

the code use create ui menu bar follows:

def initui(self):      qtooltip.setfont(qfont("sansserif", 10))      self.setcentralwidget(qwidget())      #create action use on menu bar     exitaction = qaction(qicon("logo.png"), "&exit", self)     exitaction.setshortcut("cmd+q")     exitaction.setstatustip("close application.")     exitaction.triggered.connect(self.close)      #create status bar     self.statusbar()      #attempt create menu bar, nothing happens.     menubar = self.menubar()     filemenu = menubar.addmenu("&file")     filemenu.addaction(exitaction)      #set mainwindow properties.     self.setgeometry(0, 0, 250, 150)     self.setwindowtitle("icon")     self.setwindowicon(qicon("logo.png"))     self.settooltip("this <b>main window</b>.")      self.show() 

edit: i'm using osx.

ok, seems problem i'm using osx, , filter keywords.

for more detailed answer, please check one, explained me: why doesn't menu added?


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -