[Qt-interest] Test if style implements PrimitiveElement
Jan
janusius at gmx.net
Sun Jan 16 13:19:11 CET 2011
Thank you Maximilian.
I tried it, but option.rect returns a valid (correct) rect and type
returns Frame with oxygen style.
Am 16.01.2011 11:58, schrieb Maximilian Hrabowski:
> 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
>
More information about the Qt-interest-old
mailing list