Style Sheet for custom widget
Hi all,
I made my custom widget based on QWidget, just several button and labels. How to set style sheet from my custom widget?
I set object name for widget
Code:
myWidget->setObjectName("myWidget");
and wrote small style sheet
but nothing happened. :o
The reason why I want to do it this way is because I want to have something like this in the future:
Re: Style Sheet for custom widget
Oh, I had this problem time ago myself, but I can't remember exactly the solution (and even find it now...) But you must either set autofillbackground or even provide a paintEvent() in your subclassed widget...
Re: Style Sheet for custom widget
Thanks mate! It helps! :cool:
Quote:
Originally Posted by
Lykurg
Oh, I had this problem time ago myself, but I can't remember exactly the solution (and even find it now...) But you must either set autofillbackground or even provide a paintEvent() in your subclassed widget...
Re: Style Sheet for custom widget
Could you please provide some snippets of your code? I have the same problem and the solution doesn't work for me.
I have Qt 4.6 btw