# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'untitled.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. import sys from ui import ui from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Form(object): def setupUi(self, Form): super().__init__() Form.setObjectName("Form") Form.resize(633, 434) self.label = QtWidgets.QLabel(Form) self.test = ui() self.label.setGeometry(QtCore.QRect(110, 50, 54, 12)) self.label.setObjectName("label") self.label_2 = QtWidgets.QLabel(Form) self.label_2.setGeometry(QtCore.QRect(110, 80, 54, 12)) self.label_2.setObjectName("label_2") self.label_3 = QtWidgets.QLabel(Form) self.label_3.setGeometry(QtCore.QRect(110, 110, 54, 12)) self.label_3.setObjectName("label_3") self.pushButton = QtWidgets.QPushButton(Form) self.pushButton.setGeometry(QtCore.QRect(440, 70, 75, 23)) self.pushButton.setObjectName("pushButton") self.pushButton_2 = QtWidgets.QPushButton(Form) self.pushButton_2.setGeometry(QtCore.QRect(440, 110, 75, 23)) self.pushButton_2.setObjectName("pushButton_2") self.pushButton_2.clicked.connect(self.tz) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) def retranslateUi(self, Form): _translate = QtCore.QCoreApplication.translate Form.setWindowTitle(_translate("Form", "Form")) self.label.setText(_translate("Form", "温度:xxx")) self.label_2.setText(_translate("Form", "湿度:xxx")) self.label_3.setText(_translate("Form", "光照:xxx")) self.pushButton.setText(_translate("Form", "控制LED1")) self.pushButton_2.setText(_translate("Form", "历史记录")) def tz(self): self.test.show() def back(self): self.test.hide() self.show() if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) w = Ui_Form() main = QtWidgets.QMainWindow() w.setupUi(main) main.show() app.exec_()
时间: 2024-04-05 08:33:15 浏览: 121
这是一个使用PyQt5开发的UI界面代码,其中包含了多个控件,包括QLabel、QPushButton等,以及它们的位置、大小、名称等属性。其中,通过点击按钮可以实现打开一个名为ui的界面,具体实现可以在ui.py文件中查看。此外,这段代码中还包含了一些信号和槽函数的连接,以及一些基本的界面设置,如窗口大小、标题等。
阅读全文