#Qt Stylesheets not applying on my custom widgets

13 messages · Page 1 of 1 (latest)

trim fulcrum
#

Good afternoon! I'm trying to figure out why my widget, which is a child of a QWidget, is ignoring the setStylesheet parameter. In the example, it should be colored green, but it ignores that. I've painted the background of the main window red so you can see it faster. And I added a button with a title so you can see where the widget is actually located. Can someone tell me what should I do to apply the style to it?

#

Qt 5.14.2 (gcc 5.3.1)

spice parcel
trim fulcrum
spice parcel
trim fulcrum
#

I found very few tutorials, they were all very primitive. Do you have something that you could advise?

spice parcel
#

and debug this example

#

and most importantly see how these classes handle errors

trim fulcrum
#

As I found in comments on strange forum, I must override function paintEvent()

#

But I did not find a mention of this in the documentation for QT. Now it works, but I'm not sure if it's the right solution.

spice parcel
jovial vectorBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.