Python Forum
[PyQt] Control a combobox from another python file PyQt5
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] Control a combobox from another python file PyQt5
#1
I am a python beginner, using Qt designer for creating GUI in Python and using 3 different files for now. Main, GUI and Control. I need to control the display elements in my Main Widgets based on the combo-box selected value, and the control function is specified in the Control file. Is there any way to update the same?

main.py
----------------------------------------------------------------------------
import sys
from gui import *

class MainWindow(QtWidgets.QMainWindow) :
    def __init__(self, parent=None) :
        super(MainWindow, self).__init__(parent=parent)
        ui = Ui_MainWindow()
        ui.setupUi(self)

if __name__ == "__main__" :
    app = QtWidgets.QApplication(sys.argv)
    w = MainWindow()
    w.show()
    sys.exit(app.exec_())
----------------------------------------------------------------------------
gui.py
----------------------------------------------------------------------------
from PyQt5.QtCore import QDate, QTime, QDateTime, Qt
from runfile import *
from alarmstore import *
from PyQt5.QtCore import QDateTime, Qt
from displaycontrol import *
import checkData

gl1=alarmstore.AlarmStore
global_data=gl1.userAlarms
flag=None
@QtCore.pyqtSlot(QtCore.QDate)
def KeyDecode(str):
    k1=Executetask()
    k1.handlekeypad(str)
    return

@QtCore.pyqtSlot()
def DateTimeDecodeOn(str):
    i=str.toString('dd-MM-yyyy/HH:mm')
    obj=AlarmStore()
    obj.sortAlarm(i, 'on')
    return

@QtCore.pyqtSlot()
def DateTimeDecodeOff(str):
    i=str.toString('dd-MM-yyyy/HH:mm')
    obj=AlarmStore()
    obj.sortAlarm (i, 'off')
    return

@QtCore.pyqtSlot()
def AlarmSelect(str):
    obj=DisplayControl()
    global_data=obj.alarmDispay(str)
    obj2=alarmstore.AlarmStore()
    obj2.tempAlarms=global_data
    print(obj2.tempAlarms)
    print(type(global_data))
    flag=1
    return flag

@QtCore.pyqtSlot()
def RelaySelect(str):
    print(str)
    return

class Ui_MainWindow(object):

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(540, 400)
        MainWindow.setMaximumSize(QtCore.QSize(540, 400))
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.frame = QtWidgets.QFrame(self.centralwidget)
        self.frame.setMaximumSize(QtCore.QSize(530, 350))
        self.frame.setStyleSheet("background-color: rgb(255, 255, 255);\n""background-color: rgb(137, 139, 255);")
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.gridLayout_7 = QtWidgets.QGridLayout(self.frame)
        self.gridLayout_7.setObjectName("gridLayout_7")
        self.textBrowser = QtWidgets.QTextBrowser(self.frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth())
        self.textBrowser.setSizePolicy(sizePolicy)
        self.textBrowser.setMaximumSize(QtCore.QSize(515, 41))
        self.textBrowser.setStyleSheet("font: 75 26pt \"Arial\";")
        self.textBrowser.setObjectName("textBrowser")
        self.gridLayout_7.addWidget(self.textBrowser, 0, 0, 1, 1)
        self.groupBox = QtWidgets.QGroupBox(self.frame)
        self.groupBox.setMaximumSize(QtCore.QSize(511, 121))
        self.groupBox.setStyleSheet("font: 10pt \"Arial\";")
        self.groupBox.setObjectName("groupBox")
        self.layoutWidget = QtWidgets.QWidget(self.groupBox)
        self.layoutWidget.setGeometry(QtCore.QRect(270, 30, 219, 24))
        self.layoutWidget.setObjectName("layoutWidget")
        self.gridLayout = QtWidgets.QGridLayout(self.layoutWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.relaySelect = QtWidgets.QComboBox(self.layoutWidget)
        self.relaySelect.setStyleSheet("font: 12pt \"Arial\";")
        self.relaySelect.setObjectName("relaySelect")
        self.gridLayout.addWidget(self.relaySelect, 0, 1, 1, 1)
        self.masterEnable = QtWidgets.QCheckBox(self.layoutWidget)
        self.masterEnable.setStyleSheet("font: 10pt \"Arial\";")
        self.masterEnable.setObjectName("masterEnable")
        self.gridLayout.addWidget(self.masterEnable, 0, 2, 1, 1)
        self.label_4 = QtWidgets.QLabel(self.layoutWidget)
        self.label_4.setStyleSheet("font: 10pt \"Arial\";")
        self.label_4.setObjectName("label_4")
        self.gridLayout.addWidget(self.label_4, 0, 0, 1, 1)
        self.layoutWidget1 = QtWidgets.QWidget(self.groupBox)
        self.layoutWidget1.setGeometry(QtCore.QRect(10, 30, 251, 80))
        self.layoutWidget1.setObjectName("layoutWidget1")
        self.formLayout = QtWidgets.QFormLayout(self.layoutWidget1)
        self.formLayout.setContentsMargins(0, 0, 0, 0)
        self.formLayout.setObjectName("formLayout")
        self.label = QtWidgets.QLabel(self.layoutWidget1)
        self.label.setStyleSheet("font: 10pt \"Arial\";")
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
        self.alarmSelect = QtWidgets.QComboBox(self.layoutWidget1)
        self.alarmSelect.setStyleSheet("font: 12pt \"Arial\";")
        self.alarmSelect.setObjectName("alarmSelect")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.alarmSelect)
        self.label_2 = QtWidgets.QLabel(self.layoutWidget1)
        self.label_2.setStyleSheet("font: 10pt \"Arial\";")
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_2)
        self.relayOntime = QtWidgets.QDateTimeEdit(self.layoutWidget1)
        self.relayOntime.setStyleSheet("font: 12pt \"Arial\";")
        self.relayOntime.setObjectName("relayOntime")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.relayOntime)
        self.label_3 = QtWidgets.QLabel(self.layoutWidget1)
        self.label_3.setStyleSheet("font: 10pt \"Arial\";")
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_3)
        self.relayOfftime = QtWidgets.QDateTimeEdit(self.layoutWidget1)
        self.relayOfftime.setStyleSheet("font: 12pt \"Arial\";")
        self.relayOfftime.setObjectName("relayOfftime")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.relayOfftime)
        self.layoutWidget2 = QtWidgets.QWidget(self.groupBox)
        self.layoutWidget2.setGeometry(QtCore.QRect(271, 64, 225, 48))
        self.layoutWidget2.setObjectName("layoutWidget2")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.layoutWidget2)
        self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.sunDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.sunDay.setStyleSheet("font: 10pt \"Arial\";")
        self.sunDay.setObjectName("sunDay")
        self.gridLayout_2.addWidget(self.sunDay, 0, 0, 1, 1)
        self.monDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.monDay.setStyleSheet("font: 10pt \"Arial\";")
        self.monDay.setObjectName("monDay")
        self.gridLayout_2.addWidget(self.monDay, 0, 1, 1, 1)
        self.tueDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.tueDay.setStyleSheet("font: 10pt \"Arial\";")
        self.tueDay.setObjectName("tueDay")
        self.gridLayout_2.addWidget(self.tueDay, 0, 2, 1, 1)
        self.wedDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.wedDay.setStyleSheet("font: 10pt \"Arial\";")
        self.wedDay.setObjectName("wedDay")
        self.gridLayout_2.addWidget(self.wedDay, 0, 3, 1, 1)
        self.thuDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.thuDay.setStyleSheet("font: 10pt \"Arial\";")
        self.thuDay.setObjectName("thuDay")
        self.gridLayout_2.addWidget(self.thuDay, 1, 0, 1, 1)
        self.friDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.friDay.setStyleSheet("font: 10pt \"Arial\";")
        self.friDay.setObjectName("friDay")
        self.gridLayout_2.addWidget(self.friDay, 1, 1, 1, 1)
        self.satDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.satDay.setStyleSheet("font: 10pt \"Arial\";")
        self.satDay.setObjectName("satDay")
        self.gridLayout_2.addWidget(self.satDay, 1, 2, 1, 1)
        self.allDay = QtWidgets.QCheckBox(self.layoutWidget2)
        self.allDay.setStyleSheet("font: 10pt \"Arial\";")
        self.allDay.setObjectName("allDay")
        self.gridLayout_2.addWidget(self.allDay, 1, 3, 1, 1)
        self.gridLayout_7.addWidget(self.groupBox, 1, 0, 1, 1)
        self.groupBox_2 = QtWidgets.QGroupBox(self.frame)
        self.groupBox_2.setMaximumSize(QtCore.QSize(511, 151))
        self.groupBox_2.setStyleSheet("font: 10pt \"Arial\";")
        self.groupBox_2.setObjectName("groupBox_2")
        self.line_3 = QtWidgets.QFrame(self.groupBox_2)
        self.line_3.setGeometry(QtCore.QRect(120, 20, 16, 120))
        self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_3.setObjectName("line_3")
        self.line_4 = QtWidgets.QFrame(self.groupBox_2)
        self.line_4.setGeometry(QtCore.QRect(250, 20, 16, 120))
        self.line_4.setStyleSheet("color: rgb(43, 92, 255);")
        self.line_4.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_4.setObjectName("line_4")
        self.saveAll = QtWidgets.QPushButton(self.groupBox_2)
        self.saveAll.setGeometry(QtCore.QRect(270, 20, 110, 24))
        self.saveAll.setStyleSheet("font: 10pt \"Arial\";")
        self.saveAll.setObjectName("saveAll")
        self.cancel = QtWidgets.QPushButton(self.groupBox_2)
        self.cancel.setGeometry(QtCore.QRect(270, 50, 110, 24))
        self.cancel.setStyleSheet("font: 10pt \"Arial\";")
        self.cancel.setObjectName("cancel")
        self.line_5 = QtWidgets.QFrame(self.groupBox_2)
        self.line_5.setGeometry(QtCore.QRect(380, 20, 16, 120))
        self.line_5.setFrameShape(QtWidgets.QFrame.VLine)
        self.line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_5.setObjectName("line_5")
        self.line = QtWidgets.QFrame(self.groupBox_2)
        self.line.setGeometry(QtCore.QRect(270, 80, 110, 3))
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.line_2 = QtWidgets.QFrame(self.groupBox_2)
        self.line_2.setGeometry(QtCore.QRect(270, 110, 110, 3))
        self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        self.line_7 = QtWidgets.QFrame(self.groupBox_2)
        self.line_7.setGeometry(QtCore.QRect(270, 140, 110, 3))
        self.line_7.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_7.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_7.setObjectName("line_7")
        self.layoutWidget3 = QtWidgets.QWidget(self.groupBox_2)
        self.layoutWidget3.setGeometry(QtCore.QRect(10, 20, 108, 116))
        self.layoutWidget3.setObjectName("layoutWidget3")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.layoutWidget3)
        self.gridLayout_4.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.checkData = QtWidgets.QPushButton(self.layoutWidget3)
        self.checkData.setStyleSheet("font: 10pt \"Arial\";")
        self.checkData.setObjectName("checkData")
        self.gridLayout_4.addWidget(self.checkData, 0, 0, 1, 1)
        self.createData = QtWidgets.QPushButton(self.layoutWidget3)
        self.createData.setStyleSheet("font: 10pt \"Arial\";")
        self.createData.setObjectName("createData")
        self.gridLayout_4.addWidget(self.createData, 1, 0, 1, 1)
        self.eraseData = QtWidgets.QPushButton(self.layoutWidget3)
        self.eraseData.setStyleSheet("font: 10pt \"Arial\";")
        self.eraseData.setObjectName("eraseData")
        self.gridLayout_4.addWidget(self.eraseData, 2, 0, 1, 1)
        self.initialiseData = QtWidgets.QPushButton(self.layoutWidget3)
        self.initialiseData.setStyleSheet("font: 10pt \"Arial\";")
        self.initialiseData.setObjectName("initialiseData")
        self.gridLayout_4.addWidget(self.initialiseData, 3, 0, 1, 1)
        self.layoutWidget4 = QtWidgets.QWidget(self.groupBox_2)
        self.layoutWidget4.setGeometry(QtCore.QRect(405, 19, 93, 126))
        self.layoutWidget4.setObjectName("layoutWidget4")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.layoutWidget4)
        self.gridLayout_6.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.rb1 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb1.setObjectName("rb1")
        self.gridLayout_6.addWidget(self.rb1, 0, 0, 1, 1)
        self.rb6 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb6.setObjectName("rb6")
        self.gridLayout_6.addWidget(self.rb6, 0, 1, 1, 1)
        self.rb2 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb2.setObjectName("rb2")
        self.gridLayout_6.addWidget(self.rb2, 1, 0, 1, 1)
        self.rb7 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb7.setObjectName("rb7")
        self.gridLayout_6.addWidget(self.rb7, 1, 1, 1, 1)
        self.rb3 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb3.setObjectName("rb3")
        self.gridLayout_6.addWidget(self.rb3, 2, 0, 1, 1)
        self.rb8 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb8.setObjectName("rb8")
        self.gridLayout_6.addWidget(self.rb8, 2, 1, 1, 1)
        self.rb4 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb4.setObjectName("rb4")
        self.gridLayout_6.addWidget(self.rb4, 3, 0, 1, 1)
        self.rb9 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb9.setObjectName("rb9")
        self.gridLayout_6.addWidget(self.rb9, 3, 1, 1, 1)
        self.rb5 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb5.setObjectName("rb5")
        self.gridLayout_6.addWidget(self.rb5, 4, 0, 1, 1)
        self.rb10 = QtWidgets.QRadioButton(self.layoutWidget4)
        self.rb10.setObjectName("rb10")
        self.gridLayout_6.addWidget(self.rb10, 4, 1, 1, 1)
        self.testRelay = QtWidgets.QPushButton(self.groupBox_2)
        self.testRelay.setGeometry(QtCore.QRect(270, 80, 110, 24))
        self.testRelay.setStyleSheet("font: 10pt \"Arial\";")
        self.testRelay.setObjectName("testRelay")
        self.widget = QtWidgets.QWidget(self.groupBox_2)
        self.widget.setGeometry(QtCore.QRect(141, 21, 103, 116))
        self.widget.setObjectName("widget")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.widget)
        self.gridLayout_5.setContentsMargins(0, 0, 0, 0)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.checkRtc = QtWidgets.QPushButton(self.widget)
        self.checkRtc.setStyleSheet("font: 10pt \"Arial\";")
        self.checkRtc.setObjectName("checkRtc")
        self.gridLayout_5.addWidget(self.checkRtc, 0, 0, 1, 1)
        self.initialiseRtc = QtWidgets.QPushButton(self.widget)
        self.initialiseRtc.setStyleSheet("font: 10pt \"Arial\";")
        self.initialiseRtc.setObjectName("initialiseRtc")
        self.gridLayout_5.addWidget(self.initialiseRtc, 1, 0, 1, 1)
        self.turnoffRtc = QtWidgets.QPushButton(self.widget)
        self.turnoffRtc.setStyleSheet("font: 10pt \"Arial\";")
        self.turnoffRtc.setObjectName("turnoffRtc")
        self.gridLayout_5.addWidget(self.turnoffRtc, 2, 0, 1, 1)
        self.setRtcTime = QtWidgets.QPushButton(self.widget)
        self.setRtcTime.setStyleSheet("font: 10pt \"Arial\";")
        self.setRtcTime.setObjectName("setRtcTime")
        self.gridLayout_5.addWidget(self.setRtcTime, 3, 0, 1, 1)
        self.gridLayout_7.addWidget(self.groupBox_2, 2, 0, 1, 1)
        self.gridLayout_3.addWidget(self.frame, 0, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 540, 21))
        self.menubar.setObjectName("menubar")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.label_4.setBuddy(self.alarmSelect)
        self.label.setBuddy(self.alarmSelect)
        self.label_2.setBuddy(self.relayOntime)
        self.label_3.setBuddy(self.relayOfftime)
        #self.relayOfftime.setCalendarPopup (True)
        #######################################  CONFIG WIDGET  ############################################
        self.relayOntime.setDateTime(QDateTime.currentDateTime())
        self.relayOfftime.setDateTime(QDateTime.currentDateTime())
        self.alarmSelect.addItems(['1','2','3','4','5','6','7','8','9','10'])
        #######################################  CONFIG WIDGET  ############################################
        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        #######################################  BUTTONS  ############################################
        self.checkData.clicked.connect(lambda: KeyDecode('checkData'))
        self.createData.clicked.connect(lambda: KeyDecode('createData'))
        self.eraseData.clicked.connect(lambda: KeyDecode('eraseData'))
        self.initialiseData.clicked.connect(lambda: KeyDecode('initialiseData'))
        self.checkRtc.clicked.connect(lambda: KeyDecode('checkRtc'))
        self.initialiseRtc.clicked.connect(lambda: KeyDecode('initialiseRtc'))
        self.turnoffRtc.clicked.connect(lambda: KeyDecode('turnoffRtc'))
        self.testRelay.clicked.connect(lambda: KeyDecode('testRelay'))
        self.saveAll.clicked.connect(lambda: KeyDecode('saveAll'))
        self.cancel.clicked.connect(lambda: KeyDecode('cancel'))
        self.setRtcTime.clicked.connect(lambda: KeyDecode('setRtcTime'))
        #######################################  BUTTONS  ############################################
        #######################################  CHECK BOX ###########################################
        self.masterEnable.stateChanged.connect(lambda: KeyDecode('masterEnable'))
        self.sunDay.stateChanged.connect(lambda: KeyDecode('sunDay'))
        self.monDay.stateChanged.connect(lambda: KeyDecode('monDay'))
        self.tueDay.stateChanged.connect(lambda: KeyDecode('tueDay'))
        self.wedDay.stateChanged.connect(lambda: KeyDecode('wedDay'))
        self.thuDay.stateChanged.connect(lambda: KeyDecode('thuDay'))
        self.friDay.stateChanged.connect(lambda: KeyDecode('friDay'))
        self.satDay.stateChanged.connect(lambda: KeyDecode('satDay'))
        self.allDay.stateChanged.connect(lambda: KeyDecode('allDay'))
        #######################################  CHECK BOX ###########################################
        #################################  ALARM / RELAY SELECT  #####################################
        self.relayOntime.dateTimeChanged.connect(DateTimeDecodeOn)
        self.relayOfftime.dateTimeChanged.connect(DateTimeDecodeOff)
        self.alarmSelect.activated[str].connect(AlarmSelect)
        #################################  ALARM / RELAY SELECT  #####################################
    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.textBrowser.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'Arial\'; font-size:26pt; font-weight:72; font-style:normal;\">\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:\'MS Shell Dlg 2\'; font-size:18pt; font-weight:400;\">CONTROL PANEL</span></p></body></html>"))
        self.groupBox.setTitle(_translate("MainWindow", "TIMER SETTING"))
        self.masterEnable.setText(_translate("MainWindow", "ENABLE"))
        self.label_4.setText(_translate("MainWindow", "RELAY :"))
        self.label.setText(_translate("MainWindow", "ALARM    :"))
        self.label_2.setText(_translate("MainWindow", "ON TIME  :"))
        self.label_3.setText(_translate("MainWindow", "OFF TIME :"))
        self.sunDay.setText(_translate("MainWindow", "SUN"))
        self.monDay.setText(_translate("MainWindow", "MON"))
        self.tueDay.setText(_translate("MainWindow", "TUE"))
        self.wedDay.setText(_translate("MainWindow", "WED"))
        self.thuDay.setText(_translate("MainWindow", "THU"))
        self.friDay.setText(_translate("MainWindow", "FRI"))
        self.satDay.setText(_translate("MainWindow", "SAT"))
        self.allDay.setText(_translate("MainWindow", "ALL"))
        self.groupBox_2.setTitle(_translate("MainWindow", "SYSTEM SETTINGS"))
        self.saveAll.setText(_translate("MainWindow", "SAVE ALL"))
        self.cancel.setText(_translate("MainWindow", "CANCEL"))
        self.checkData.setText(_translate("MainWindow", "CHECK DATA"))
        self.createData.setText(_translate("MainWindow", "CREATE DATA"))
        self.eraseData.setText(_translate("MainWindow", "ERASE DATA"))
        self.initialiseData.setText(_translate("MainWindow", "INITIALISE DATA"))
        self.rb1.setText(_translate("MainWindow", "R1"))
        self.rb6.setText(_translate("MainWindow", "R6"))
        self.rb2.setText(_translate("MainWindow", "R2"))
        self.rb7.setText(_translate("MainWindow", "R7"))
        self.rb3.setText(_translate("MainWindow", "R3"))
        self.rb8.setText(_translate("MainWindow", "R8"))
        self.rb4.setText(_translate("MainWindow", "R4"))
        self.rb9.setText(_translate("MainWindow", "R9"))
        self.rb5.setText(_translate("MainWindow", "R5"))
        self.rb10.setText(_translate("MainWindow", "R10"))
        self.testRelay.setText(_translate("MainWindow", "TEST RELAY"))
        self.checkRtc.setText(_translate("MainWindow", "CHECK RTC"))
        self.initialiseRtc.setText(_translate("MainWindow", "INITIALISE RTC"))
        self.turnoffRtc.setText(_translate("MainWindow", "TURN OFF RTC"))
        self.setRtcTime.setText(_translate("MainWindow", "SET RTC TIME"))
----------------------------------------------------------------------------
After executing the AlarmSelect() function, I need to update my main window widgets based on the returned value. Is there any way to control the elements from a third file? Any help is appreciated. I had tried to create the object of GUI in another file, and when accessing the GUI elements, application is crashing. Also tried to create a flag and tried to update the elements in the setupUi method, it is also not working(hope it will work based on event only).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Python 3.10 and PyQt5(6) zazen000 2 340 Jun-14-2021, 05:02 PM
Last Post: deanhystad
  [python] [Tkinter] Problem bidding combobox with np.array NEL 3 1,320 Aug-04-2019, 11:07 AM
Last Post: Yoriz
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 1,277 Apr-06-2019, 11:15 PM
Last Post: ZenWoR
  pyqt5 combobox add item with loop shift838 5 6,449 Dec-09-2018, 08:54 PM
Last Post: shift838
  [PyQt] enter from py exported by pyqt5 designer to another py file royer14 0 1,288 Jun-29-2018, 01:45 AM
Last Post: royer14
  PyQt5 - import rext from other file - despearte for help D_frucht 1 1,347 May-26-2018, 06:37 AM
Last Post: Barrowman
  [PyQt5] [QWebEngineView] HTML file download nolme 0 3,548 May-08-2018, 08:41 PM
Last Post: nolme
  Anaconda 5.1 Python can't see PYQT5 PJ03029174 6 4,461 May-05-2018, 11:04 PM
Last Post: PJ03029174
  need help with combobox Python 2.7 ZipSnipe 3 2,817 Feb-04-2018, 05:06 PM
Last Post: Larz60+
  [PyQt] how to install pyqt5 for python 3.5.2 64bit lemonred 2 17,359 Oct-28-2016, 03:25 PM
Last Post: lemonred

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020