QToolTip 设置提示信息
2024-09-03 17:55:25
import sys
from PyQt5.QtWidgets import (QWidget, QToolTip,
QPushButton, QApplication)
from PyQt5.QtGui import QFont class Example(QWidget): def __init__(self):
super().__init__()
self.initUI() def initUI(self):
#Window设置
self.setGeometry(300, 300, 300, 200)
self.setWindowTitle('Tooltip提示信息')
self.setToolTip('This is a <b>Window</b>')
self.setFont(QFont('consolas',10)) #设置整个Window内字体 # Button设置
btn = QPushButton('Button', self)
btn.move(50, 50)
btn.resize(50,30)
#btn.setFont(QFont('simsun',12)) #仅设置Button的字体
btn.setToolTip('This is a <b>Button</b>') self.show() if __name__ == '__main__': app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
最新文章
- Atitit sql计划任务与查询优化器--统计信息模块
- oracle细节
- 【BZOJ】【3164】【HEOI2013】Eden的博弈问题
- sublime text2中ctags安装问题的解决
- 图的最小生成树(Prim、Kruskal)
- 我用爬虫一天时间“偷了”知乎一百万用户,只为证明PHP是世界上最好的语言
- Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn
- jQuery中间each实施例的方法
- mongo数据库备份与恢复
- codeforces 755C. PolandBall and Forest
- P1361 小M的作物
- AC Dream1069
- spark-2.4.0-hadoop2.7-高可用(HA)安装部署
- springboot2.0以后WebMvcConfigurationSupport代替WebMvcConfigurationAdapter
- Codeforces 1132G Greedy Subsequences [线段树]
- __class__属性与元类
- vmware工具克隆linux系统步骤及配置
- mysql 阿里内核人员
- Spring主从数据库的配置和动态数据源切换原理
- sparkr脚本