Absolute beginner here, have no idea what I am doing wrong. All I want to do here is have the pushButton in PyQt5 to change to "Working..." and Red when clicked... which it currently does. Thing is I need it to also change back to the default "SCAN" and Green color when done running that method the button is linked to...
I know this is a super simple problem, and forgive any Novice errors in this code. I know very very little but if you guys can help me I would highly appreciate it!!! :) from PyQt5 import QtCore, QtGui, QtWidgets import sys import pyautogui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.showMaximized() MainWindow.setMinimumSize(QtCore.QSize(0, 0)) MainWindow.setMaximumSize(QtCore.QSize(3840, 2160)) font = QtGui.QFont() font.setFamily("Arial Black") MainWindow.setFont(font) MainWindow.setStyleSheet("background-color: rgba(0, 85, 127, 100);") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.pushButton = QtWidgets.QPushButton(self.centralwidget) self.pushButton.setGeometry(QtCore.QRect(250, 250, 400, 150)) font = QtGui.QFont() font.setFamily("Tahoma") font.setPointSize(24) font.setBold(True) font.setWeight(75) self.pushButton.setFont(font) self.pushButton.setStyleSheet("background-color: rgb(0, 170, 0);\n" "color: rgb(255, 255, 255);") self.pushButton.setObjectName("pushButton") self.label = QtWidgets.QLabel(self.centralwidget) self.label.setGeometry(QtCore.QRect(730, 300, 701, 111)) font = QtGui.QFont() font.setPointSize(18) font.setBold(True) font.setItalic(False) font.setWeight(75) self.label.setFont(font) self.label.setLayoutDirection(QtCore.Qt.LeftToRight) self.label.setObjectName("label") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1920, 18)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) self.label.setStyleSheet("background-color: rgba(0, 85, 127, 0);\n" "color: rgb(255, 255, 255);") self.pushButton.setText(_translate("MainWindow", "SCAN")) self.label.setText(_translate("MainWindow", "WELCOME")) self.pushButton.clicked.connect(self.copy) def copy(self, MainWindow): self.pushButton.setText('WORKING...') self.pushButton.setStyleSheet("background-color: rgb(250, 0, 0);\n" "color: rgb(255, 255, 255);") testprompt=storeid=pyautogui.prompt(text='test', title='test') class Application(): def run(): import sys app = QtWidgets.QApplication(sys.argv) MainWindow = QtWidgets.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() sys.exit(app.exec_()) Application.run() -- https://mail.python.org/mailman/listinfo/python-list