In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to achieve three sets of stylesheets in Qt. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
I. Preface
In doing a variety of projects, it is inevitable to encounter the need to set their own interface style, and the qss provided by Qt is powerful in order to customize a variety of skins. In fact, a perfect UI interface is mainly composed of two pieces, one is color matching, the other is layout, both of which are indispensable, usually given to professional art sisters, most programmers are not very aesthetic. So when you don't have an artist sister, you need to go to some professional UI interface websites for inspiration. On the two points of color matching and layout, many people have a misunderstanding, thinking that only qss can be put in, in fact, it is not possible, if the button text box is ugly, it also looks unsightly, and you need to slowly adjust the position of various human-computer interaction controls.
Before using Qt to do a skin generator, you can use it to quickly make skin, the fastest time a set of skin only 58 seconds, using skin generator to make skin, basically no more than a minute to generate a set of skin you want, as long as you set up eight colors. I like this set of black style skin very much and specially share it. There are two other sets of skin, one is light blue style and the other is white flat style. You are welcome to use it at will.
2. Code ideas / / use method void frmMain::initStyle () {/ / load stylesheet / / QFile file (": / qss/psblack.css"); / / QFile file (": / qss/flatwhite.css"); QFile file (": / qss/lightblue.css"); if (file.open (QFile::ReadOnly)) {QString qss = QLatin1String (file.readAll ()); QString paletteColor = qss.mid (20,7) QApp- > setPalette (QPalette (QColor (paletteColor)); qApp- > setStyleSheet (qss); file.close ();}} III.
This is the end of the article on "how to achieve three stylesheets in Qt". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.