开发者

QT set window background

开发者 https://www.devze.com 2022-12-12 04:28 出处:网络
I have scoured through the documentation looking for a way to change the main window\'s background to开发者_Go百科 an image I have located in the project file. I tried to use a palette with no luck. M

I have scoured through the documentation looking for a way to change the main window's background to开发者_Go百科 an image I have located in the project file. I tried to use a palette with no luck. My question is, how and what is the easiest way to change the background of a window?

Thank You for any help, Zach Smith


Did you try using the Qt StyleSheet ?

Example :

QMainWindow{
 background-image: url(:/images_section/application_icon);
 }
0

精彩评论

暂无评论...
验证码 换一张
取 消