I am a beginner and would like to know where and how to code the loading of two comboboxes. The GUI was created in QT designer. First, I have the code to show the form:
import sys from PyQt5.QtWidgets import QApplication from mainwindow import UIMainWindow app = QApplication(sys.argv) window = UIMainWindow() window.show() sys.exit(app.exec_())I also have this code for my mainwindow
from PyQt5.QtWidgets import QMainWindow from ui_summary import Ui_MainWindow class UIMainWindow(QMainWindow): def __init__self): super(UIMainWindow, self).__init__() self.ui = Ui_MainWindow() self.ui.setupUi(self)So, here is the code I have to load two comboboxes (MS and State). I need to know if it is correct and where to put it.
self.MS.additem(MStatusBox) self.State.additem(StateComboBox) MStatusBox = ['M', 'S'] StateComboBox = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KN', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY']Thanks -- again I am a beginner, please be patient with me