def create_button(text=u'', layout=None, tooltip=None, icon=None, enabled=True, default=False):
 button = QtWidgets.QPushButton()
 button.setCursor(Qt.PointingHandCursor)
 if text:
  button.setText(text)
 if (icon is not None):
  button.setIcon(icon)
  button.setIconSize(QtCore.QSize(defs.small_icon, defs.small_icon))
 if (tooltip is not None):
  button.setToolTip(tooltip)
 if (layout is not None):
  layout.addWidget(button)
 if (not enabled):
  button.setEnabled(False)
 if default:
  button.setDefault(True)
 return button

def create_button ( text = u'' , layout = None , tooltip = None , icon = None , enabled = True , default = False ) : button = QtWidgets . QPushButton ( ) button . setCursor ( Qt . PointingHandCursor ) if text : button . setText ( text ) if ( icon is not None ) : button . setIcon ( icon ) button . setIconSize ( QtCore . QSize ( defs . small_icon , defs . small_icon ) ) if ( tooltip is not None ) : button . setToolTip ( tooltip ) if ( layout is not None ) : layout . addWidget ( button ) if ( not enabled ) : button . setEnabled ( False ) if default : button . setDefault ( True ) return button
create a button .