PDA

View Full Version : Customised QWidget border



chandan
2nd March 2011, 12:55
Hi Guys,
I have created a customised QWidget and now I want a border around it. So I have used stylesheet to do that using following bit of code.



QString String = "border: 2px solid black;";
setStylesheet(String );


The above code is drawing border around all the child widget of that customised widget. But I dont want that. I want just a single border around the customised widget. Is that possible without using the paint event?

Thanks.
Chandan

e8johan
2nd March 2011, 18:08
You need to apply a selector, e.g. mytype { ... }