資源簡介
個人收集的Python3.x+Pyqt5制作GUI界面的案例,可以參考其制作GUI界面,設計界面結構等。

代碼片段和文件信息
import?math
from?Ui_form1?import?Ui_MainWindow
#?pyqt類
from?PyQt5?import??QtGui?QtWidgets?QtCore
from?PyQt5.QtCore?import?*
from?PyQt5.QtGui?import?*
from?PyQt5.QtWidgets?import?*
from?PyQt5.QtWinExtras?import?*
#?正則式庫??自動按鍵庫
#import?images_rc
import?re
#?import?pyautogui?as?auto
#?matplotlib類
import?matplotlib.pyplot?as?plt
import?matplotlib.patches?as??mpatches
from?matplotlib.backends.backend_qt5agg?import?FigureCanvasQTAgg?as?FigureCanvas
#from?matplotlib.backends.backend_qt5?import?NavigationToolbar2QT?as?NavigationToolbar
import?numpy?as?np
#from?mylineedit?import?MyLineEdit
class?Function(QDialog?Ui_MainWindow):
????def?__init__(self?parent=None):
????????super(Function?self).__init__(parent)
????????self.setupUi(self)
????????self.zujian()
????????self.Type2.setEnabled(True)
????????self.row=0
????????self.ksb=1
#????def?resizeEvent(self?event):
????def?zujian(self):
????????
????????self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)#行選擇模式
????????self.tableWidget.horizontalHeader().setSectionresizeMode(QHeaderView.Stretch)#等寬
????????
#????????regExp1?=?QRegExp(r‘(?:-?\d+?)‘)??#?正則規則1
#????????regExp2?=?QRegExp(r‘^\d*$‘)??#?正則規則1
#????????self.lineEdit22.setValidator(QRegExpValidator(regExp2?self))
#????????self.lineEdit23.setValidator(QRegExpValidator(regExp2?self))
#??‘‘‘?============================================?彈?簧?區?域??=========================================彈?簧?區?域??=========================================‘‘‘
????????self.spacerItem1?=?QtWidgets.QSpacerItem(150?20?QtWidgets.QSizePolicy.Preferred?QtWidgets.QSizePolicy.Minimum)
????????self.horizontalLayout_6.addItem(self.spacerItem1)
????????self.horizontalLayout11?=?QtWidgets.QHBoxLayout()
????????self.horizontalLayout11.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
????????self.horizontalLayout11.setSpacing(0)
????????self.horizontalLayout11.setobjectName(“horizontalLayout11“)
????????self.horizontalLayout_6.addLayout(self.horizontalLayout11)
????????self.horizontalLayout_6.addLayout(self.horizontalLayout11)
????????self.spacerItem2?=?QtWidgets.QSpacerItem(150?20?QtWidgets.QSizePolicy.Preferred?QtWidgets.QSizePolicy.Minimum)
????????self.horizontalLayout_6.addItem(self.spacerItem2)
#??‘‘‘=============================================?彈?簧?區?域??=======================================彈?簧?區?域??=========================================‘‘‘?????
#????????????self.spacerItem1.changeSize(100?20?QtWidgets.QSizePolicy.Preferred?QtWidgets.QSizePolicy.Minimum)#改變彈簧長度
#????????????self.horizontalLayout_6.invalidate()???????#?重新布局
????????self.fig?=?plt.figure(dpi=70)
????????self.canvas?=?FigureCanvas(self.fig)
????????self.axes?=?self.fig.add_subplot(111)
????????self.axes.set_xticks(np.linspace(-100?550?14?endpoint=True))
????????self.axes.set(xlim=[-50?550]?ylim=[-150?150])
????????self.axes.axis(‘off‘)
????????self.horizontalLayout11.addWidget(self.canvas)
#????????self.tableWidget.
#????????FigureCanvas.setSizePolicy(self
#????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????459??2018-05-31?00:13??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\first-test-master.iml
?????文件????????228??2018-05-31?00:13??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\inspectionProfiles\profiles_settings.xm
?????文件????????213??2018-05-31?00:13??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\misc.xm
?????文件????????286??2018-05-31?00:13??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\modules.xm
?????文件??????23983??2018-05-31?08:11??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\workspace.xm
?????文件??????45444??2018-03-27?11:10??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\form1.ui
?????文件??????39399??2018-05-31?01:01??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\function.py
?????文件????????224??2018-03-27?11:10??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\images.qrc
?????文件??????74780??2018-03-27?11:10??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\images_rc.py
?????文件????????120??2018-03-27?11:10??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\README.md
?????文件??????29138??2018-05-31?01:02??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\Ui_form1.py
?????文件??????18650??2018-05-31?00:42??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\__pycache__\images_rc.cpython-35.pyc
?????文件??????16593??2018-05-31?01:02??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\__pycache__\Ui_form1.cpython-35.pyc
?????目錄??????????0??2018-05-31?08:11??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\inspectionProfiles
?????目錄??????????0??2018-05-31?08:11??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea
?????目錄??????????0??2018-05-31?08:11??Python3.x+Pyqt5制作GUI界面的案例\first-test-master\__pycache__
?????目錄??????????0??2018-05-31?08:11??Python3.x+Pyqt5制作GUI界面的案例\first-test-master
?????目錄??????????0??2018-05-31?08:12??Python3.x+Pyqt5制作GUI界面的案例
-----------?---------??----------?-----??----
???????????????249517????????????????????18
評論
共有 條評論