当前位置:网站首页>QT_ QSS file easy-to-use tutorial
QT_ QSS file easy-to-use tutorial
2022-07-21 01:11:00 【Lee1989 Qi】
List of articles
One 、 establish qss Resource file
Add... Just like adding image resources , The suffix is changed to qss You can create a style sheet file
Default build file
Two 、 application qss File decoration interface control
Specific and detailed syntax reference network
Here is a qss file , Decorate the window that references the file
3、 ... and 、 quote qss File mode
One 、
QFile file(":/style.qss");// Absolute path
/* Judge whether the file exists */
if (file.exists() ) {
/* Open as read-only */
file.open(QFile::ReadOnly);
/* Save the read result as a string */
QString styleSheet = QLatin1String(file.readAll());
/* Set global style */
qApp->setStyleSheet(styleSheet);
/* Close file */
file.close();
}
Two 、
CommonHelper::setStyleSheet
(":/misc/calculatorwidget/style/default.qss",
this);
Four 、 If there are multiple same controls in the same interface , Different styles are required
Write in control
QLabel QLabel1;
QLabel QLabel2;
QLabel2.setObjectName(“backlight_icon”);
qss file
contact
Make a blog friend , Technology sharing, exchange and contact the author Q Group :586025772
边栏推荐
- Build product array
- STM32 learning ---spi
- Some rules for implicit conversion of SAP ABAP character and string variables
- What is the difference between zero trust and SASE? The answer is not really important
- [pyGame] the classic boss of soul duel is back. Are you ready to defeat them again? (source code attached)
- 【LeetCode】12. Balanced binary tree
- The way to practice and fight strange things: the difference between npm/cnpm I -d and -s and -g and - save [the difference between cnpm and NPM]
- Web APIs DOM event delegation + comprehensive case
- How does win11 enable taskbar diversification? Win11 how to open a new taskbar
- 力扣128题:最长连续序列
猜你喜欢
IDEA:Lambda expression are not supported at language level ‘5‘
电气成套设备制造企业项目管理难点及解决方案
ORA-39194: Table mode jobs require the tables to be comma separated.
【LeetCode】12. Balanced binary tree
想低成本保障軟件安全?五大安全任務值得考慮
Leetcode- number of occurrences of numbers in the array (single dog problem)
Makefile details
Unlock high scores | eBay deepens user experience and optimizes large screen device applications
性能监控 之 Prometheus 三剑客安装案例
TestNG自动化测试框架详解
随机推荐
网络流,二分图与图的匹配
How does win11 enable taskbar diversification? Win11 how to open a new taskbar
Hollysys PLC master-slave station communication
Online sandbox collection
创建文件,如果文件的上级(或上上级等)目录不存在,则先创建上级目录,再创建文件
构建乘积数组
uview錶單,身份證,鍵盤,實時驗證
[731. My schedule II]
Leetcode- number of occurrences of numbers in the array (single dog problem)
【模型评估】
【LeetCode】12. Balanced Binary Tree·平衡二叉樹
Under what circumstances is it necessary for enterprises to introduce distributed databases?
Makefile详解
Isecops intelligent security operation technology system framework
JSON【代码演示详解,带你精通 JSON】
CCTV news "Nanjing rent quota invoice by hand" news channel_ People's network
[SWPU2019]Web1-1|SQL注入
零信任和SASE有什么不一样?答案其实并不重要
Unity Shader着色器学习(二)
[pyGame] the classic boss of soul duel is back. Are you ready to defeat them again? (source code attached)