[Qt-interest] **JUNK** Re: custom shaped buttons

Ross Bencina rossb-lists at audiomulch.com
Tue Feb 7 10:42:52 CET 2012


On 7/02/2012 4:46 PM, Tibo W wrote:
 > QStyleOptionButton opt;
 > initStyleOption(&opt);
[snip]
 > Unfortunately, there doesn’t seem to be any way to extract the style for
 > the button “pressed” state from the palette, it simply doesn’t seem to
 > be there, though it is magically available in Qt’s own pushbutton
 > renderer.

I'm pretty sure you'll find it in the style option "state" field. 
According to the docs for QStyle::State the QStyle::State_Sunken bit 
should be set.

http://developer.qt.nokia.com/doc/qt-4.8/qstyle.html#StateFlag-enum

if( opt.state & QStyle::State_Sunken )
     ... button is pressed ...

Ross.



More information about the Qt-interest-old mailing list