Dont fail if a QPushButton gets added to the toolbars somehow

This commit is contained in:
Kovid Goyal 2019-04-02 06:49:37 +05:30
parent 25e10f1032
commit 36b63758a2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -225,9 +225,10 @@ class ToolBar(QToolBar): # {{{
if ch is None:
ch = self.child_bar.widgetForAction(ac)
ch.setCursor(Qt.PointingHandCursor)
ch.setAutoRaise(True)
if hasattr(ch, 'setText') and hasattr(ch, 'text'):
self.all_widgets.append(ch)
if hasattr(ch, 'setAutoRaise'): # is a QToolButton or similar
ch.setAutoRaise(True)
m = ac.menu()
if m is not None:
if menu_mode is not None: