![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pyqt5
pursuit_zhangyu
人工智障
展开
-
pyqt5使用按钮跳转界面
简介进行按钮进行界面的跳转,我这里面我介绍两种,一种是没有使用Qtdesigner的代码,另一种是使用Qtdesigner的代码代码1import sysfrom PyQt5.QtWidgets import QMainWindow, QPushButton, QApplicationclass First(QMainWindow): def __init__(se...原创 2018-10-01 14:00:50 · 17692 阅读 · 8 评论 -
pyqt5 给按钮设置css样式和界面背景设置
具体代码如下import sysfrom PyQt5.QtWidgets import QWidget, QPushButton, QApplicationfrom PyQt5.QtGui import QPalette, QBrush, QPixmap class Example(QWidget): def __init__(self): s...原创 2018-10-01 16:42:02 · 12337 阅读 · 0 评论 -
pyqt5使用本地摄像头
代码如下 #!/usr/bin/python# -*- coding: UTF-8 -*-import sysimport cv2from PyQt5 import QtCore, QtGui, QtWidgetsfrom PyQt5.QtWidgets import *from PyQt5.QtCore import *from PyQt5.QtGui import QPa...原创 2018-10-01 16:56:29 · 12175 阅读 · 12 评论 -
pyqt5使用label显示图片
关于label的介绍很详细的地址:https://zhuanlan.zhihu.com/p/32134728代码如下import sysfrom PyQt5.QtWidgets import QWidget, QPushButton, QApplication, QLabelfrom PyQt5.QtGui import QPalette, QBrush, QPixmap ...原创 2018-10-01 20:54:38 · 25910 阅读 · 4 评论 -
pyqt5设置按钮,移上去变为手型
具体设为手型的代码self.button.setCursor(QCursor(Qt.PointingHandCursor))具体的测试代码如下:import sysfrom PyQt5.QtWidgets import QApplication, QWidget, QPushButtonfrom PyQt5.QtGui import QCursorfrom PyQt5.QtC...原创 2018-10-20 10:51:42 · 3639 阅读 · 1 评论 -
pyqt5实现按钮添加背景图片以及背景图片的切换
简介对与控件QPushButton中的可以使用setStyleSheet设置它背景图片。具体设置背景图片的方法有两种self.button.setStyleSheet("QPushButton{background-image: url(img/1.png)}")然而对于这种方法背景图片无法进行边框的自适应,可以使用下面的方法self.button.setStyleSheet(...原创 2018-10-20 15:12:41 · 23301 阅读 · 2 评论 -
pyqt5获取显示器的分辨率
代码如下import sysfrom PyQt5.QtWidgets import QApplication, QWidgetclass Example(QWidget): def __init__(self): super().__init__() self.initUI() # 界面绘制交给InitUi方法 def init...原创 2018-10-29 16:28:14 · 6768 阅读 · 2 评论