|
楼主 |
发表于 2023-2-23 17:28:29
|
显示全部楼层
- from PySide2 import QtCore
- from PySide2 import QtWidgets as QtGui
- from PySide2.QtCore import *
- from PySide2.QtGui import *
- from PySide2.QtWidgets import *
- class Ui_Widget(object):
- def setupUi(self, Widget):
- if not Widget.objectName():
- Widget.setObjectName(u"Widget")
- Widget.resize(800, 600)
- self.pushButton = QPushButton(Widget)
- self.pushButton.setObjectName(u"pushButton")
- self.pushButton.setGeometry(QRect(70, 60, 631, 61))
- self.toolButton = QToolButton(Widget)
- self.toolButton.setObjectName(u"toolButton")
- self.toolButton.setGeometry(QRect(583, 140, 121, 31))
- self.retranslateUi(Widget)
- QMetaObject.connectSlotsByName(Widget)
- # setupUi
- def retranslateUi(self, Widget):
- Widget.setWindowTitle(QCoreApplication.translate("Widget", u"Widget", None))
- self.pushButton.setText(QCoreApplication.translate("Widget", u"PushButton", None))
- self.toolButton.setText(QCoreApplication.translate("Widget", u"...", None))
- # retranslateUi
- class MyWidget(Ui_Widget,QtGui.QWidget):
- def __init__(self,parent=None):
- super(MyWidget,self).__init__(parent)
- self.setupUi(self)
- widget = MyWidget()
- widget.show()
复制代码 |
|