Results 1 to 5 of 5

Thread: Shape of QGraphicsPixmapItem

  1. #1
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Shape of QGraphicsPixmapItem

    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.

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Shape of QGraphicsPixmapItem

    Seems to work for me with Qt/X11 4.3.0. Could you attach the image so we can test ourselves?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Shape of QGraphicsPixmapItem

    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.
    Attached Images Attached Images

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Shape of QGraphicsPixmapItem

    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.
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    StefanHirche (6th September 2007)

  6. #5
    Join Date
    Jan 2007
    Posts
    5
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Shape of QGraphicsPixmapItem

    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.

Similar Threads

  1. shape of push button
    By Seema Rao in forum Qt Programming
    Replies: 23
    Last Post: 2nd April 2008, 02:05
  2. shape of a pushbutton
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 16th August 2007, 09:58
  3. Shape changing under other tab using slider/spinbox
    By kramed in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 20:59
  4. Rotate QGraphicsPixmapItem
    By durbrak in forum Qt Programming
    Replies: 7
    Last Post: 15th April 2007, 15:51
  5. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 08:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.