def newAction(
        parent,
        text,
        slot=None,
        shortcutName=None,
        icon=None,
        tip=None,
        checkable=False,
        enabled=True,
        checked=False, ):
    """Create a new action and assign callbacks, shortcuts, etc."""
    a = QtWidgets.QAction(text, parent)
    a.setData(shortcutName)
    # a = QtWidgets.QAction("", parent)
    if icon is not None:
        a.setIconText(text.replace(" ", "\n"))
        a.setIcon(newIcon(icon))
    shortcut = shortcuts.get(shortcutName, None)
    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)
    a.setChecked(checked)
    return a
Create a new action and assign callbacks, shortcuts, etc.
EISeg/eiseg/util/qt.py