the "MINI" function has the purpose of minimizing the window when the appropriate button is clicked. needless to say it doesn't work it doesn't give me any kind of error, I really don't know how to do it
from PyQt5 import QtCore, QtGui, QtWidgets
import win32com.client as win32
class Ui_MainWindow(object):
#more code before
def setupUi(self, MainWindow):
self.pushButton_3 = QtWidgets.QPushButton(self.widget_7, clicked=lambda: self.mini())
self.pushButton_3.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton_3.setText("")
#more code after
def mini(self):
w = QtWidgets.QMainWindow()
w.showMinimized()
if "__ name__" == '__ main __':
import sys
import salvataggioicone_rc
app = QtWidgets.QApplication(sys.argv)
ex = Ui_MainWindow()
w = QtWidgets.QMainWindow()
ex.setupUi(w)
statusbar = w.statusBar()
w.show()
sys.exit(app.exec_())
I tried putting "w.showMinimize() in the section "if name == 'main':" and it works, but as soon as I put it inside the "MINI" function it does nothing