合集-PyQt5

摘要:from PyQt5 import QtCore, QtGui import sys import cv2 if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) main_win = QtWidgets.QMainWind 阅读全文
posted @ 2024-06-04 15:32 星空28 阅读(93) 评论(0) 推荐(0)
摘要:from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) ma 阅读全文
posted @ 2024-06-04 15:37 星空28 阅读(73) 评论(0) 推荐(0)
摘要:图片滚动 import os from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class ButtonPanel(QtWidgets.QWidget): def __init__(se 阅读全文
posted @ 2024-06-04 17:20 星空28 阅读(100) 评论(0) 推荐(0)
摘要:from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 def click_btn1(): print("click button 1") txt_label.setText("我是按钮1点击 阅读全文
posted @ 2024-06-04 15:44 星空28 阅读(65) 评论(0) 推荐(0)
摘要:from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) main_win = Qt 阅读全文
posted @ 2024-06-04 15:39 星空28 阅读(45) 评论(0) 推荐(0)
摘要:from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class ButtonPanel(QtWidgets.QWidget): def __init__(self, *args, **kw 阅读全文
posted @ 2024-06-04 15:38 星空28 阅读(169) 评论(0) 推荐(0)
摘要:from PyQt5.QtCore import * class MyTypeSignal(QObject): # 定义一个信号 sendmsg = pyqtSignal(object) # 发送3个参数的信号 sendmsg1 = pyqtSignal(str, int, int) def run 阅读全文
posted @ 2024-06-08 05:34 星空28 阅读(40) 评论(0) 推荐(0)
摘要:窗口类型: QMainWindow:可以包含菜单栏、工具栏、状态栏、标题栏 QWidget:不确定窗口的用途,就使用QWidget QDialog: 是对话窗口的基类,没有菜单栏、工具栏、状态栏 from PyQt5.QtWidgets import QWidget, QDesktopWidget, 阅读全文
posted @ 2024-06-07 16:47 星空28 阅读(56) 评论(0) 推荐(0)
摘要:""" 菜单栏 """ from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class ButtonPanel(QtWidgets.QWidget): def __init__(self, 阅读全文
posted @ 2024-06-07 15:04 星空28 阅读(90) 评论(0) 推荐(0)
摘要:import os.path from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class SpinBoxPanel(QtWidgets.QWidget): def __init__(s 阅读全文
posted @ 2024-06-05 12:11 星空28 阅读(112) 评论(0) 推荐(0)
摘要:""" 复选框 """ import os.path from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class ButtonPanel(QtWidgets.QWidget): def 阅读全文
posted @ 2024-06-05 10:38 星空28 阅读(126) 评论(0) 推荐(0)
摘要:import os.path from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class ButtonPanel(QtWidgets.QWidget): def __init__(se 阅读全文
posted @ 2024-06-05 09:27 星空28 阅读(74) 评论(0) 推荐(0)
摘要:from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class TextDemoPanel(QtWidgets.QWidget): def __init__(self, *args, ** 阅读全文
posted @ 2024-06-05 07:07 星空28 阅读(68) 评论(0) 推荐(0)
摘要:选择文件夹,显示图片 import os from PyQt5 import QtWidgets from PyQt5 import QtCore, QtGui import sys import cv2 class ButtonPanel(QtWidgets.QWidget): def __ini 阅读全文
posted @ 2024-06-04 18:12 星空28 阅读(124) 评论(0) 推荐(0)
摘要:from PyQt5.QtWidgets import * import pyqtgraph as pg import sys class MainWindow(QWidget): def __init__(self): super().__init__() self.setWindowTitle( 阅读全文
posted @ 2024-06-13 06:37 星空28 阅读(140) 评论(0) 推荐(0)
摘要:实例1:CPU使用率实时展示 from PyQt5 import QtWidgets,QtCore,QtGui import pyqtgraph as pg import sys import traceback import psutil class MainUi(QtWidgets.QMainW 阅读全文
posted @ 2024-06-13 06:16 星空28 阅读(726) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class WindowMaxMin(QWidget): def __init__(self, *args, * 阅读全文
posted @ 2024-06-11 06:01 星空28 阅读(134) 评论(0) 推荐(0)
摘要:from PyQt5.QtWidgets import * import sys class BasicQCSS(QWidget): def __init__(self): super().__init__() self.setWindowTitle("QSS样式/子控件选择器") btn1 = Q 阅读全文
posted @ 2024-06-10 15:40 星空28 阅读(78) 评论(0) 推荐(0)
摘要:from PyQt5.QtWidgets import * import sys class BasicQCSS(QWidget): def __init__(self): super().__init__() self.setWindowTitle("QSS样式") btn1 = QPushBut 阅读全文
posted @ 2024-06-10 15:22 星空28 阅读(80) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class Drawing(QWidget): def __init__(self, *args, **kwar 阅读全文
posted @ 2024-06-10 14:32 星空28 阅读(46) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class WindowPattern(QMainWindow): def __init__(self, *ar 阅读全文
posted @ 2024-06-09 16:03 星空28 阅读(46) 评论(0) 推荐(0)
摘要:设置窗口控件风格 QApplication.setStyle(...) 窗口可以显示三种风格:['windowsvista', 'Windows', 'Fusion'] import sys from PyQt5.QtCore import * from PyQt5.QtGui import * f 阅读全文
posted @ 2024-06-09 15:03 星空28 阅读(170) 评论(0) 推荐(0)
摘要:方法一:不使用信号与槽 MultiWin.py文件 """ 多窗口交互--不使用信号与槽 """ import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from Da 阅读全文
posted @ 2024-06-08 17:04 星空28 阅读(174) 评论(0) 推荐(0)
摘要:from PyQt5.QtCore import * from PyQt5 import QtCore from PyQt5.QtWidgets import * import sys class OverrideSlot(QMainWindow): def __init__(self): supe 阅读全文
posted @ 2024-06-08 15:46 星空28 阅读(36) 评论(0) 推荐(0)
摘要:方法一:lambda表达式传递参数 from PyQt5.QtCore import * from PyQt5 import QtCore from PyQt5.QtWidgets import * import sys class LambdaSlotArg(QMainWindow): def _ 阅读全文
posted @ 2024-06-08 15:38 星空28 阅读(110) 评论(0) 推荐(0)
摘要:方法一: from PyQt5.QtCore import * from PyQt5.QtWidgets import * import sys class AutoSignalSlot(QWidget): def __init__(self): super().__init__() self.se 阅读全文
posted @ 2024-06-08 13:31 星空28 阅读(73) 评论(0) 推荐(0)
摘要:import time from PyQt5.QtCore import * from PyQt5.QtWidgets import * import sys class BackendThread(QThread): update_date = pyqtSignal(str) def run(se 阅读全文
posted @ 2024-06-08 12:30 星空28 阅读(37) 评论(0) 推荐(0)
摘要:from PyQt5.QtCore import * from PyQt5.QtWidgets import * import sys class WinSignal(QWidget): # 定义一个信号 button_clicked_signal = pyqtSignal() def __init 阅读全文
posted @ 2024-06-08 11:59 星空28 阅读(62) 评论(0) 推荐(0)
摘要:··· from PyQt5.QtCore import * class NNSignal(QObject): # 定义一个信号 signal1 = pyqtSignal() # 发送3个参数的信号 signal2 = pyqtSignal(int) signal3 = pyqtSignal() d 阅读全文
posted @ 2024-06-08 09:57 星空28 阅读(25) 评论(0) 推荐(0)
摘要:··· from PyQt5.QtCore import * class MultiSignal(QObject): # 定义一个信号 signal1 = pyqtSignal() # 发送3个参数的信号 signal2 = pyqtSignal(int) signal3 = pyqtSignal( 阅读全文
posted @ 2024-06-08 06:51 星空28 阅读(44) 评论(0) 推荐(0)
摘要:import os import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * if __name__ == '__main__': app = QApplication( 阅读全文
posted @ 2024-06-15 05:35 星空28 阅读(50) 评论(0) 推荐(0)
摘要:import os import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidgets import * class W 阅读全文
posted @ 2024-06-14 17:21 星空28 阅读(82) 评论(0) 推荐(0)
摘要:""" 加载本地web页面 """ import os import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidget 阅读全文
posted @ 2024-06-14 17:14 星空28 阅读(55) 评论(0) 推荐(0)
摘要:""" 用web浏览器控件QWebEngineView显示网页 PyQT5和Web交互技术 使用python和web混合开发 Python + JavaScript + HTML5 + CSS """ import sys from PyQt5.QtCore import * from PyQt5. 阅读全文
posted @ 2024-06-14 16:56 星空28 阅读(91) 评论(0) 推荐(0)
摘要:""" 动态显示当前时间 QTimer QThread """ from PyQt5.QtWidgets import QWidget, QMessageBox, QVBoxLayout, QPushButton, QLCDNumber, QApplication, QListWidget, QGr 阅读全文
posted @ 2024-06-14 16:49 星空28 阅读(48) 评论(0) 推荐(0)
摘要:""" 动态显示当前时间 QTimer QThread """ from PyQt5.QtWidgets import QWidget, QPushButton, QApplication, QListWidget, QGridLayout, QLabel from PyQt5.QtCore imp 阅读全文
posted @ 2024-06-14 15:06 星空28 阅读(60) 评论(0) 推荐(0)
摘要:QStackWidget堆栈窗口 from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * import sys class stackwidgetDemo(QTabWidget): def 阅读全文
posted @ 2024-06-14 14:47 星空28 阅读(119) 评论(0) 推荐(0)
摘要:参考:https://www.cnblogs.com/Yanjy-OnlyOne/p/12302955.html 阅读全文
posted @ 2024-06-14 14:46 星空28 阅读(31) 评论(0) 推荐(0)
摘要:import os, sys, re from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt from PyQt5.QtGui import QBrush ''' void currentCellChanged(int currentRow 阅读全文
posted @ 2024-06-14 14:25 星空28 阅读(77) 评论(0) 推荐(0)
摘要:实例1 import sys from PyQt5.QtCore import Qt from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QMainWindow, QMessageBox, QApplication, QWidget, 阅读全文
posted @ 2024-06-14 14:07 星空28 阅读(87) 评论(0) 推荐(0)
摘要:实例1: from PyQt5.QtWidgets import QMessageBox, QListView, QStatusBar, QMenuBar, QMenu, QAction, QLineEdit, QStyle, QFormLayout, QVBoxLayout,QWidget,QAp 阅读全文
posted @ 2024-06-14 11:08 星空28 阅读(114) 评论(0) 推荐(0)
摘要:二维表 数据源 需要创建QTableView实例和一个数据源Model,然后将两者关联 MVC: Model + Viewer + Controller MVC的目的是将后端的数据和前端页面的耦合度降低 import sys from PyQt5 import QtPrintSupport, QtG 阅读全文
posted @ 2024-06-14 11:02 星空28 阅读(67) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5 import QtPrintSupport, QtGui from PyQt5.QtPri 阅读全文
posted @ 2024-06-14 10:53 星空28 阅读(64) 评论(0) 推荐(0)
摘要:参考https://www.cnblogs.com/jgg54335/p/14904853.html 实例一: import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QPainter, 阅读全文
posted @ 2024-06-13 17:50 星空28 阅读(86) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * class FontDialogdemo(QWidget): def __init__(self, parent 阅读全文
posted @ 2024-06-13 17:25 星空28 阅读(46) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class InputdialogDemo(QWidget): def __init__(self, paren 阅读全文
posted @ 2024-06-13 17:18 星空28 阅读(46) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class QMessageBoxDemo(QWidget): def __init__(self): supe 阅读全文
posted @ 2024-06-13 15:49 星空28 阅读(78) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class QDialogDemo(QMainWindow): def __init__(self): supe 阅读全文
posted @ 2024-06-13 15:25 星空28 阅读(45) 评论(0) 推荐(0)
摘要:from PyQt5.QtWidgets import QApplication, QWidget, QStackedLayout, QVBoxLayout from PyQt5.QtWidgets import QPushButton, QComboBox, QSizePolicy import 阅读全文
posted @ 2024-06-13 09:23 星空28 阅读(183) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * class spindemo(QWidget): def __init__(self, parent=None) 阅读全文
posted @ 2024-06-13 07:05 星空28 阅读(65) 评论(0) 推荐(0)
摘要:import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class QSliderDemo(QWidget): def __init__(self): super(QS 阅读全文
posted @ 2024-06-13 07:01 星空28 阅读(132) 评论(0) 推荐(0)
摘要:PyQtGraph绘图参考 http://v3.byhy.net/tut/py/gui/pyqtgraph-1/ 阅读全文
posted @ 2024-06-13 06:53 星空28 阅读(37) 评论(0) 推荐(0)
摘要:from PyQt5.QtWidgets import * import pyqtgraph as pg import sys class MainWindow(QWidget): def __init__(self): super().__init__() self.setWindowTitle( 阅读全文
posted @ 2024-06-13 06:45 星空28 阅读(172) 评论(0) 推荐(0)
摘要:from PyQt5.QtWidgets import * import pyqtgraph as pg import sys class MainWindow(QWidget): def __init__(self): super().__init__() self.setWindowTitle( 阅读全文
posted @ 2024-06-13 06:41 星空28 阅读(191) 评论(0) 推荐(0)
摘要:QFileDialog的介绍和使用 QFileDialog是Qt框架中提供的一个文件选择对话框。它可以让用户通过图形界面的方式选择文件或目录,并提供了许多与文件操作相关的实用功能,例如文件过滤、文件类型限制、文件名默认值、默认目录等。 它具有以下常用的静态方法: getOpenFileName(): 阅读全文
posted @ 2025-01-30 16:15 星空28 阅读(253) 评论(0) 推荐(0)