PDA

View Full Version : Shape of QGraphicsPixmapItem



StefanHirche
31st August 2007, 10:54
Hi.
Is there any known problem with the shape() of a QGraphicsPixmapItem. I use a PNG with transparent parts and then try to move it around. But I can drag the item also when I click on a transparent part of the item. Not in a rect around the item. It's a little arbitrary where I can drag and where not. :confused:

I tried to plot the QPixmap.mask(), so this seems to be correct, only opaque parts of the PNG are black, all transparent parts white. And I tried to plot the shape() QPath. And this seems to be correct. I tried all three possible shapeModes. MaskShape does not do the trick I want to have, HeuristicMaskShape not, because I do not set a Heuristic Mask, and BoundingRect does at least what is expected.

Thing is, I'm quite sure that it worked with a former Qt-Version. At the moment I use the KDE4 qt-copy from yesterday (8/30/2007).

Thanks for any help.

jpn
3rd September 2007, 20:11
Seems to work for me with Qt/X11 4.3.0. Could you attach the image so we can test ourselves?

StefanHirche
4th September 2007, 13:55
Sure.
The image is black and transparent.
For instance between the legs, there are small parts that are "really" transparent, so one can't move it there, but the vast space seems to be not transparent.

jpn
4th September 2007, 18:09
Alright, I can now see the problem. My own test image I used earlier was way too simple. :) It works fine with Qt 4.2.3 and Qt 4.3.1, but in Qt 4.3.0 it indeed seems to be somehow broken. So I suppose the qt-copy in question is based on Qt 4.3.0.

StefanHirche
5th September 2007, 16:14
Yeah, I have the same idea.
Yesterday I checked out the new version and deed a complete recompile from scratch. Now it is working fine again. I hope, it stays like this.

So thanks alot for your effort.