diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-07-13 15:19:40 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2011-07-13 15:44:48 -0300 |
commit | c489162de563b73529b0e44e1df50499b39fb753 (patch) | |
tree | 2951c962e90bdf9b3064862a93325bd3bb3fb6f2 | |
parent | bb7bb75e41e745dbb118d493316ad3f268d3202d (diff) |
Do not set QMenuBar parent on MacOS.
Fix bug #907.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
-rw-r--r-- | pysideuic/uiparser.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pysideuic/uiparser.py b/pysideuic/uiparser.py index 56f5d27..4142de4 100644 --- a/pysideuic/uiparser.py +++ b/pysideuic/uiparser.py @@ -167,14 +167,19 @@ class UIParser(object): if widget_class == 'Line': widget_class = 'QFrame' - # Ignore the parent if it is a container. + # Ignore the parent if it is a container parent = self.stack.topwidget + + # if is a Menubar on MacOS + macMenu = (sys.platform == 'darwin') and (widget_class == 'QMenuBar') + if isinstance(parent, (QtGui.QDockWidget, QtGui.QMdiArea, QtGui.QScrollArea, QtGui.QStackedWidget, QtGui.QToolBox, QtGui.QTabWidget, - QtGui.QWizard)): + QtGui.QWizard)) or macMenu: parent = None + # See if this is a layout widget. if widget_class == 'QWidget': if parent is not None: |