• 大小: 56KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-03
  • 语言: Python
  • 标签: Python3.x  Pyqt5  

资源简介

个人收集的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.xml

     文件        213  2018-05-31 00:13  Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\misc.xml

     文件        286  2018-05-31 00:13  Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\modules.xml

     文件      23983  2018-05-31 08:11  Python3.x+Pyqt5制作GUI界面的案例\first-test-master\.idea\workspace.xml

     文件      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


评论

共有 条评论