Skip to content

Instantly share code, notes, and snippets.

@ChrisBeaumont
Created February 14, 2013 23:27
Show Gist options
  • Save ChrisBeaumont/4957345 to your computer and use it in GitHub Desktop.
Save ChrisBeaumont/4957345 to your computer and use it in GitHub Desktop.
The menu bar in this script doesn't display. It *does* display if QMenuBar is created without a reference to its parent. This bug has been reported at https://bugreports.qt-project.org/browse/PYSIDE-21?focusedCommentId=195277&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-195277
from PySide import QtCore, QtGui
app = QtGui.QApplication([''])
mw = QtGui.QMainWindow()
#mbar = QtGui.QMenuBar() # menu visible
mbar = QtGui.QMenuBar(mw) # menu not visible
menu = QtGui.QMenu(mbar)
menu.setTitle("Testing")
mbar.addMenu(menu)
mw.setMenuBar(mbar)
mw.show()
mw.raise_()
app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment