PySide6 aboutQt()函数详细教程

PySide6.QtWidgets.QApplication类的aboutQt()函数用于显示一个关于Qt的简单消息框;该消息包括应用程序正在使用的Qt版本号;

示例代码

import sys
from PySide6.QtWidgets import QApplication,QWidget,QPushButton,QVBoxLayout
from PySide6.QtCore import Slot

class MyWidget(QWidget):
    def __init__(self):
        super().__init__()

        self.button = QPushButton("关于")
        self.layout = QVBoxLayout(self)
        self.layout.addWidget(self.button)
        self.button.clicked.connect(self.about)

    @Slot()
    def about(self):
        app.aboutQt() #显示一个关于Qt的消息框

app = QApplication([])
widget = MyWidget()
widget.resize(300, 200)
widget.show()
sys.exit(app.exec())

运行效果

QApplication.aboutQt()

原创内容,如需转载,请注明出处;

本文地址: https://www.perfcode.com/p/pyside6-qtwidgets-qapplication-aboutqt.html

分类: 计算机技术
推荐阅读:
Rust while 条件循环 Rust 内置了while循环结构;当条件为真时,执行循环,当条件不为真时,停止循环;
requests中读取和设置Cookie 读取和设置Cookie中也非常简单;requests返回的Response中包含一个cookies属性,访问它,将返回一个RequestsCookieJar对象。
一条命令下载整个网站 在Linux系统下,你可以通过一条命令来下载整个网站,并按照网站的目录结构生成对应的文件夹及网页文件:
cannot fallthrough final case in switch的解决方法 在Go语言中,fallthrough 用于 switch 语句的 case 块中,它将会在当前 case 块执行完后执行下一个 case 块,不论下个 case 块条件是否匹配,但如果 fallthrough 后没有 case ,则会产生 cannot fallthrough final case in switch 的错误。
Python max()函数 max() 是 Python 中的一个内置函数,用于返回给定可迭代对象中的最大值。
使用pip安装Python PIL库的正确方法 正确使用pip工具安装Python中PIL库的方法如下: