qt - Borders and background of QWidget aren't set by stylesheet -


i've set stylesheet of qwidget change borders , background,

#gui {     border: 4px inset #515c84;     border-radius: 9px;     background-image: url(./back.png) } 

its name gui neither border nor background shown.

override paintevent in qwidget subclass this:

void mywidget::paintevent(qpaintevent *e) {     qstyleoption opt;     opt.init(this);     qstylepainter p(this);     p.drawprimitive(qstyle::pe_widget, opt); } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -