PDA

View Full Version : PrimitiveElemet's Paint Area



derick
26th January 2006, 23:09
Hi,

How do I get the default style's paint area for painting a primitive in Qt3?



const QStyle &aStyle = QApplication::style();
QStyle::SFlags flags = QStyle::Style_Default;
if( YeboGogo)
flags |= QStyle::Style_On | QStyle::Style_Enabled;
else
flags |= QStyle::Style_Off | QStyle::Style_Enabled;

aStyle.drawPrimitive( QStyle::PE_Indicator, p, QRect(2,2,cr.height()-2,cr.height()-2), cg, flags);
...
...



Ie, I would like to calculate the correct size for the QRect parameter.
Regards,

derick
1st February 2006, 16:52
Found it :)

QSize QStyle::sizeFromContents ( ContentsType contents, const QWidget * widget, const QSize & contentsSize, const QStyleOption & opt = QStyleOption::Default ) const [pure virtual]