24 lines
693 B
Python
24 lines
693 B
Python
from PySide2 import QtWidgets, QtGui
|
|
|
|
|
|
def Push_Button (text, clicked = None, icon = None) :
|
|
button = QtWidgets.QPushButton (text)
|
|
if clicked :
|
|
button.clicked.connect (clicked)
|
|
if icon :
|
|
button.setIcon (QtGui.QIcon (icon))
|
|
return button
|
|
# end def Push_Button
|
|
|
|
#class Push_Button (QtWidgets.QPushButton) :
|
|
#
|
|
# def __init__ ( self, text
|
|
# , callback = None
|
|
# , icon = None
|
|
# ) :
|
|
# super ().__init__ (text)
|
|
# if callback :
|
|
# self.clicked.connect (callback)
|
|
# if icon :
|
|
# self.setIcon (QtGui.QIcon (icon))
|
|
# # end def |