当前位置:网站首页>QT 使用QToolTip 鼠标放上去显示文字时会把按钮的图片也显示了、修改提示文字样式
QT 使用QToolTip 鼠标放上去显示文字时会把按钮的图片也显示了、修改提示文字样式
2022-07-06 20:28:00 【程序媛zcc】
使用 QToolTip 时遇到的问题:
1、鼠标放上去会把 QPushButton 的 背景图 显示出来
2、设置 QToolTip 样式时不成功
if(preview) {//预览开
ui->preview->setStyleSheet("border-image:url(:/style/preview_icon.png);");
ui->preview->setToolTip("关闭预览");
} else {
ui->preview->setStyleSheet("border-image:url(:/style/n_preview_icon.png);");
ui->preview->setToolTip("开启预览");
}
修改代码后:
if(preview) {//预览开
ui->preview->setStyleSheet("QPushButton{border-image:url(:/style/preview_icon.png);}"
"QToolTip{background-color: #ffffff; color:#484848;}");
ui->preview->setToolTip("关闭预览");
} else {
ui->preview->setStyleSheet("QPushButton{border-image:url(:/style/n_preview_icon.png);}"
"QToolTip{background-color: #ffffff; color:#484848;}");
ui->preview->setToolTip("开启预览");
}
边栏推荐
- Create applet from 0
- 22.(arcgis api for js篇)arcgis api for js圆采集(SketchViewModel)
- Jerry's RTC clock development [chapter]
- [Dameng database] after backup and recovery, two SQL statements should be executed
- HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
- 枚举通用接口&枚举使用规范
- [safe office and productivity application] Shanghai daoning provides you with onlyoffice download, trial and tutorial
- 源代码保密的意义和措施
- Principle of attention mechanism
- 密码学系列之:在线证书状态协议OCSP详解
猜你喜欢
21.(arcgis api for js篇)arcgis api for js矩形采集(SketchViewModel)
我的勇敢对线之路--详细阐述,浏览器输入URL发生了什么
Under the tide of "going from virtual to real", Baidu AI Cloud is born from real
哈夫曼树基本概念
Search of linear table
Shangsilicon Valley JVM Chapter 1 class loading subsystem
海思万能平台搭建:颜色空间转换YUV2RGB
My brave way to line -- elaborate on what happens when the browser enters the URL
Appx code signing Guide
Jericho is in non Bluetooth mode. Do not jump back to Bluetooth mode when connecting the mobile phone [chapter]
随机推荐
华为小米互“抄作业”
Code quality management
大白话高并发(二)
存储过程与函数(MySQL)
树莓派设置wifi自动连接
qt-线程等01概念
Clock in during winter vacation
Do you know the five most prominent advantages of E-bidding?
How to customize the shortcut key for latex to stop running
Cryptography series: detailed explanation of online certificate status protocol OCSP
【达梦数据库】添加自动收集统计信息的任务
U.S. Air Force Research Laboratory, "exploring the vulnerability and robustness of deep learning systems", the latest 85 page technical report in 2022
C# Task拓展方法
【C语言】 题集 of Ⅸ
[tools] basic concept of database and MySQL installation
VHDL实现单周期CPU设计
卡尔曼滤波-1
unrecognized selector sent to instance 0x10b34e810
Significance and measures of source code confidentiality
【达梦数据库】备份恢复后要执行两个sql语句