def newAction(parent, text, slot=None, shortcut=None, icon=None, tip=None, checkable=False, enabled=True):
 a = QAction(text, parent)
 if (icon is not None):
  a.setIcon(newIcon(icon))
 if (shortcut is not None):
  if isinstance(shortcut, (list, tuple)):
   a.setShortcuts(shortcut)
  else:
   a.setShortcut(shortcut)
 if (tip is not None):
  a.setToolTip(tip)
  a.setStatusTip(tip)
 if (slot is not None):
  a.triggered.connect(slot)
 if checkable:
  a.setCheckable(True)
 a.setEnabled(enabled)
 return a

def newAction ( parent , text , slot = None , shortcut = None , icon = None , tip = None , checkable = False , enabled = True ) : a = QAction ( text , parent ) if ( icon is not None ) : a . setIcon ( newIcon ( icon ) ) if ( shortcut is not None ) : if isinstance ( shortcut , ( list , tuple ) ) : a . setShortcuts ( shortcut ) else : a . setShortcut ( shortcut ) if ( tip is not None ) : a . setToolTip ( tip ) a . setStatusTip ( tip ) if ( slot is not None ) : a . triggered . connect ( slot ) if checkable : a . setCheckable ( True ) a . setEnabled ( enabled ) return a
create a new action and assign callbacks .