Zach Smith
Zach Smith

Reputation: 133

QT set window background

I have scoured through the documentation looking for a way to change the main window's background to 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

Upvotes: 2

Views: 3501

Answers (1)

Andy M
Andy M

Reputation: 6065

Did you try using the Qt StyleSheet ?

Example :

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

Upvotes: 1

Related Questions