[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Rendering of list items on a graphics view crashes
From:       Stefan Majewsky <majewsky () gmx ! net>
Date:       2008-08-24 12:21:43
Message-ID: 200808241421.49744.majewsky () gmx ! net
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Am Sonntag 24 August 2008 00:19:27 schrieb Stefan Majewsky:
> Hello,
>
> I'm trying to render some QGraphicsWidgets. Their background should look
> like list items, therefore I try to use QStyle::drawPrimitive. The code is
> as follows:
>
> void MyGraphicsWidget::paint(QPainter* painter, const
> QStyleOptionGraphicsItem* option, QWidget* widget)
> {
> 	//imitate the style of a standard list item
> 	QStyleOption opt(*option);
> 	widget->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt,
> painter, widget);
> }
>
> (I'm copying the QStyleOption because I'm intending to change the state
> depending on my widget's state.) This code crashes in the drawPrimitive
> call, and I cannot figure out why. Does anyone know?
>
> Good night
> Stefan

The problem was that the QStyle tries to cast my QStyleOptionGraphicsItem into 
a QStyleOptionViewItem. I have decided to code a completely different system.

Stefan

["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic