[Qt-interest] Test if style implements PrimitiveElement

Maximilian Hrabowski hrabowski at clausmark.com
Sun Jan 16 11:58:15 CET 2011


Hi,

maybe querying the style for the size of the frame or use using pixelMetric would be sufficient for you - this should result in 0-sizes for your given case.

Cheers,
Maxim

----- Original Message -----
From: Jan <janusius at gmx.net>
To: qt-interest at qt.nokia.com
Sent: Sun, 16 Jan 2011 11:27:23 +0100 (CET)
Subject: [Qt-interest] Test if style implements PrimitiveElement

Hi,

what is the best way (if any exists) to test if a QStyle implements a 
PrimitiveElement?

I have a custom widget where I do some drawing in paintEvent. I am also 
drawing a frame :

style()->drawPrimitive(QStyle::PE_Frame, &option, &painter, this);

Unfortunately GTK+ and Oxygen styles do not draw any frames.

Currently I am doing this to check the style in a changeEvent

     if (event->type() == QEvent::StyleChange)
         mFrame = (QFrame::style()->metaObject()->className() != 
QString(aStyleClassName).toAscii());

and if  it is e.g. oxygen I am drawing a frame myself.

Would be nicer if I could test if e.g. PE_FRAME is implemented.
Any ideas?

Jan


_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110116/3e42a418/attachment.html 


More information about the Qt-interest-old mailing list