关于pyqt5如何使用下拉框中的选项触发事件(ui窗体)

关于pyqt5如何使用下拉框中的选项触发事件(ui窗体),第1张

接主程序:

# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'start_test.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_Dialog(object):
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(422, 187)
        self.text = QtWidgets.QLabel(Dialog)
        self.text.setGeometry(QtCore.QRect(9, 9, 231, 32))
        self.text.setObjectName("text")
        self.choose = QtWidgets.QComboBox(Dialog)
        self.choose.setGeometry(QtCore.QRect(260, 50, 135, 25))
        self.choose.setObjectName("choose")
        self.choose.addItem("")
        self.choose.addItem("")
        self.choose.addItem("")
        self.choose.addItem("")
        self.start_test = QtWidgets.QPushButton(Dialog)
        self.start_test.setGeometry(QtCore.QRect(150, 130, 89, 25))
        self.start_test.setObjectName("start_test")

        self.retranslateUi(Dialog)
        self.start_test.clicked.connect(Dialog.close)
        QtCore.QMetaObject.connectSlotsByName(Dialog)

    def retranslateUi(self, Dialog):
        _translate = QtCore.QCoreApplication.translate
        Dialog.setWindowTitle(_translate("Dialog", "测试模式"))
        self.text.setText(_translate("Dialog", "

请选择您要测试的雷达:

")) self.choose.setItemText(0, _translate("Dialog", "请选择:")) self.choose.setItemText(1, _translate("Dialog", "多线激光雷达")) self.choose.setItemText(2, _translate("Dialog", "前单线激光雷达")) self.choose.setItemText(3, _translate("Dialog", "后单线激光雷达")) self.start_test.setText(_translate("Dialog", "开始测试"))

主程序链接如下:
https://mp.csdn.net/mp_blog/creation/editor/124315251

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/730928.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-27
下一篇 2022-04-27

发表评论

登录后才能评论

评论列表(0条)

保存