Hi,
I found the solution. You need to fiddle with the QStyleOptionGraphicsItem *option that is passed to the paint function.
My custom widget subclasses QGraphicsPixmapItem. I had reimplemented the paint function to call the regular paint funct and then my custom stuff. What I do now is as follows
myoption.
state &= !QStyle::State_Selected;
.... my own drawing routines ....
void ThumbnailItem::paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
QStyleOptionGraphicsItem myoption = (*option);
myoption.state &= !QStyle::State_Selected;
QGraphicsPixmapItem::paint(painter, &myoption, widget);
.... my own drawing routines ....
To copy to clipboard, switch view to plain text mode
So I trap option, unset the option.state QStyle::State_selected bit, and then pass it on. I then have my own code for indicating its selected.
http://doc.trolltech.com/3.3/qstyle.html#details
http://doc.trolltech.com/4.2/qstyleo...m-members.html
-K
Bookmarks