[Qt-interest] Using QStyleSheet to Restyle Checkable Menu Items

Jake Colman colman at ppllc.com
Fri Sep 17 14:26:25 CEST 2010


I would like to restyle checkable menu items so that they display a
small checkbox that is red when checked and clear when unchecked.  With
Qt3 I used a QCustomMenuItem and a derived paint() method to precisely
render the size of the checkbox and the desired behavior.  With Qt4 it
appears that QStyleSheet is the way to go is ::indicator subcontrol.
But, although I have reviewed the relevant docs I am stymied as to how
to do this.  Can someone help me get started with something that
approximates what I am looking to do?

Thanks.

...Jake


-- 
Jake Colman | Director, Software Development
Principia Partners LLC
101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
e: colman at ppllc.com | w: www.principiapartners.com
Credit technology innovation awards winner 2008 and 2009




More information about the Qt-interest-old mailing list