久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

C++ over Qt:控制標簽和按鈕的透明度

C++ over Qt : Controlling transparency of Labels and Buttons(C++ over Qt:控制標簽和按鈕的透明度)
本文介紹了C++ over Qt:控制標簽和按鈕的透明度的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

好吧,我再次嘗試使用 Qt Creator 上的 Linux GUI 應用程序,我在我的項目的 Qt 資源文件中添加了幾個圖像.我試圖在我的主窗口和其他窗口和對話框中擁有一個漂亮的背景.我使用的是樣式表選項(無編碼).

Well, I was again trying my hands on a Linux GUI app on Qt Creator, I added couple of images in a Qt resource file of my project. And I tried to have a nice background in my main window and other windows and dialogs. I was using from the stylesheets option (no coding).

我無法設置標簽和按鈕的透明度級別.關于如何從 Qt Creator GUI 本身做到這一點的任何想法???
!我附上了我的應用程序外觀的快照.

I am unable to set the transparency level of labels and pushbuttons. Any ideas on how to do it from Qt creator GUI itself ???
!I am attaching a snap of how my application looks.

推薦答案

可以通過設置樣式表來設置QLabel或者QPushbutton的透明度:

You can set transparency of QLabel or QPushbutton by setting the stylesheet :

ui->label->setStyleSheet("background-color: rgba(255, 255, 255, 0);");
ui->button->setStyleSheet("background-color: rgba(255, 255, 255, 0);");

您還可以在設計器中將 background-color: rgba(255, 255, 255, 0); 添加到小部件的 styleSheet 屬性中.

You can also add background-color: rgba(255, 255, 255, 0); to the styleSheet property of the widget in the designer.

第四個參數是 alpha.您還可以通過將 alpha 設置為大于零的某個值來擁有半透明小部件:

The fourth parameter is alpha. You can also have semi-transparent widgets by setting alpha to some value more than zero :

ui->button->setStyleSheet("background-color: rgba(255, 255, 255, 50);");

這篇關于C++ over Qt:控制標簽和按鈕的透明度的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How can I read and manipulate CSV file data in C++?(如何在 C++ 中讀取和操作 CSV 文件數據?)
In C++ why can#39;t I write a for() loop like this: for( int i = 1, double i2 = 0; (在 C++ 中,為什么我不能像這樣編寫 for() 循環: for( int i = 1, double i2 = 0;)
How does OpenMP handle nested loops?(OpenMP 如何處理嵌套循環?)
Reusing thread in loop c++(在循環 C++ 中重用線程)
Precise thread sleep needed. Max 1ms error(需要精確的線程睡眠.最大 1ms 誤差)
Is there ever a need for a quot;do {...} while ( )quot; loop?(是否需要“do {...} while ()?環形?)
主站蜘蛛池模板: 第四色播日韩第一页 | 三级av免费 | 久久国产欧美日韩精品 | 一区二区在线免费播放 | 婷婷免费视频 | 免费午夜剧场 | 欧美成人一区二区三区 | 亚洲精品二区 | 男女午夜激情视频 | 国产成人综合久久 | 狠狠操av| 国产在线精品一区二区 | 伊人久久成人 | 国产精品一区二区视频 | 一级在线免费观看 | 亚洲视频在线免费观看 | 欧美www在线观看 | 精品久久久久一区二区国产 | 极品粉嫩国产48尤物在线播放 | 欧美在线视频一区二区 | 中文区中文字幕免费看 | av黄色在线观看 | 国产精品第2页 | 亚洲一区中文字幕在线观看 | 九色av| 91麻豆精品国产91久久久久久久久 | 日本精品一区 | 久久精品亚洲欧美日韩久久 | 日韩国产免费观看 | 国产电影一区二区在线观看 | 久久久久久免费毛片精品 | 久草院线 | 丁香色婷婷 | 91精品国产综合久久精品 | 久草精品视频 | 91久久国产综合久久91精品网站 | 亚洲欧美激情四射 | 五月综合久久 | 成人网av | 久久鲁视频 | 国产 欧美 日韩 一区 |