A
A
Alexander2021-03-21 22:27:47
Qt
Alexander, 2021-03-21 22:27:47

Why is the background-image of the main window set to all the widgets that only exist in this window?

I want to put a picture on the background of the mainwindow, and make other backgrounds for the widgets of this window. But the mainwindow background is placed on all widgets at once.
How to treat it through ui?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ighor July, 2021-03-21
@Shemapp

StyleSheet is inherited by all child widgets.
You need to create a style specifying which widgets it should apply to.
Read https://doc.qt.io/qt-5/stylesheet-reference.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question