PDA

View Full Version : Insert a background image



arcadi1988
19th July 2017, 09:25
Hi people,

I'm very newe in Qt language and now i'm experimenting with the widgets. Actually I have a problem with a background images, I'm trying to insert a background image to my aplication in fullscreen, but it's replicated inside the buttons.

Can somebody help me?

1st Image: I select the QWidget-->StyleSheet-->insert background image
2nd Image:We can see the button has adquiered the background (1rst error)
3th Image: In the execution time with extended windowscreen, the button has the background and no background aplication (2nd error)

12515
12516
12517

high_flyer
19th July 2017, 10:17
Welcome!
Qt is not a language but a framework.
You probably are using C++ as a language.

Have a look at the stylesheet selectors: http://doc.qt.io/qt-5.9/stylesheet-syntax.html#selector-types
You will notice that by using QWidget you are using the Type selector, which matches all widgets.
Since QPushButton is also a widget, it effects the buttons too.
One way would be to use the ID selector: QWidget#<your widgets object name>
This will then select on that specific widget.