首页 > 其他分享 >PyQT5之label

PyQT5之label

时间:2024-06-04 15:45:10浏览次数:11  
标签:__ font win label PyQT5 QtWidgets main


from PyQt5 import QtWidgets
from PyQt5 import QtCore, QtGui
import sys


if __name__ == '__main__':

    app = QtWidgets.QApplication(sys.argv)
    main_win = QtWidgets.QMainWindow()
    main_win.setWindowTitle("我的第一个PyQT5应用")
    label = QtWidgets.QLabel()
    label.setText("Hello, PyQT5")
    # label.setBaseSize(100, 150)
    # label.setScaledContents()
    # pix = pixmap.scaled(QtCore.QSize(620, 500), QtCore.Qt.KeepAspectRatio)  # 自动保持比例放缩方式
    # label.setPixmap(pix)   # 设置图像显示
    label.setAlignment(QtCore.Qt.AlignCenter)   # label上居中显示
    label.setStyleSheet("background-color:blue;color:green")    # 背景颜色设置
    font = QtGui.QFont()
    font.setBold(True)
    font.setPointSizeF(32)
    label.setFont(font)
    main_win.setCentralWidget(label)
    main_win.setMinimumSize(1080, 720)
    main_win.show()
    app.exec_()

标签:__,font,win,label,PyQT5,QtWidgets,main
From: https://www.cnblogs.com/jackchen28/p/18230959

相关文章

  • 记录 anaconda安装labelimg
    前提:已经安装anaconda1、下载labelimg:labelImg:LabelImgisnowpartoftheLabelStudiocommunity.ThepopularimageannotationtoolcreatedbyTzutalinisnolongeractivelybeingdeveloped,butyoucancheckoutLabelStudio,theopensourcedatalabelingtoo......
  • Mac M1 使用 labelimg
    如果按照正常的流程下载完qypt5在终端中使用labelimg时会报这个错误下面直接讲使用方法首先进入labelimg的github网址下载网址:GitHub-HumanSignal/labelImg:LabelImgisnowpartoftheLabelStudiocommunity.ThepopularimageannotationtoolcreatedbyTzutal......
  • Qt QLabel标签添加点击事件
    .h1//给label添加事件2booleventFilter(QObject*obj,QEvent*event);.cpp1boolMainWindow::eventFilter(QObject*obj,QEvent*event){2//mousebuttonpressed3if(event->type()==QEvent::MouseButtonPress){4QMouseEvent*mouseE......
  • Understanding and Mitigating the Label Noise in Pre-training on Downstream Tasks
    目录概符号说明经验性的结果NoisyModelLearning代码ChenH.,WangJ.,ShahA.,TaoR.,WeiH.,XieX.,SugiyamaM.andRajB.Understandingandmitigatingthelabelnoiseinpre-trainingondownstreamtasks.概本文讨论如果预训练模型在训练的时候存在噪声,会......
  • 基于MCTS的三维四子棋AI模拟和基于PyQt5的应用交互界面
    '''三维四子棋是在三维空间率先四子连珠的游戏,在传统五子棋基本被研究透的情况下,三维四子棋增加了规则和难度,更加考验计算力、空间感、观察力和想象力。本模块实现三维四子棋的GUI。仅供学习和参考。BySoulCheungOnMay28thEmail:[email protected]:1594983583'''......
  • 解决labelme中AI Model Ai Mask Ai Polygon选项下载onnx权重慢或者无法下载问题
    新版的labelme中已经内置了AIModel功能,能够通过模型智能识别图像中想要标注的区域,能够显著减少工作量。但是第一次使用这个功能的时候会要下载模型权重,此时一般速度会非常慢,或者出现报错无法下载,下面提出一种解决方法。如图,有5种模型,每个模型需要分别下载encoder和decoder两......
  • Labels and Databases for Mac( 数据库标签制作软件)1.8.0版
     LabelsandDatabasesforMac一款数据库标签制作和设计软件。LabelsandDatabases可以帮助您使用各种内置标签格式创建标签、信封和卡片,并使用用户数据库中包含的信息填充它们,即使用MailMerge创建和打印标签。LabelsandDatabasesforMac(数据库标签制作软件)软件......
  • GCC编译遇到“a label can only be part of a statement and a declaration is not a
    问题原因:switch中case里面的局部变量出错解决方法:将case里面定义的局部变量在switch外面定义。//报错情况switch(fork()){case-1:error(1,errno,"fork");case0://子进程执行命令if(execvp(args[0]......
  • python 离线按照PyQt5
    首先外网下载所需要的安装包1.新建虚拟环境python-mvenvQtTest2.安装PyQt5和PyQt5-tools这两个库pipinstallpyQt5-tool-ihttps://mirrors.aliyun.com/pypi/simple/pipinstallPyQt5-tool-ihttps://mirrors.aliyun.com/pypi/simple/3.导出requirements.txt这个文......
  • k8s——pod(label和selector)
    k8s的label和selector在Kubernetes中,label和selector是两个重要的概念,它们一起用于实现资源对象的关联和调度。label创建label有两种方式创建label:在配置文件中指定label标签使用kubectllabel命令临时创建labelkubectllabelpo资源名字app=hello//定义的label-......