Results 1 to 3 of 3

Thread: QtEmbedded 4.70 QGraphicsItemGroup Problem

  1. #1
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default QtEmbedded 4.70 QGraphicsItemGroup Problem

    Hi,
    I am transitioning from Qt4.41 -> Qt4.70. This is working without problem on Qt4.4.1. I am having a problem with QT4.70 QGraphicsItemGroup. If I add my QGraphicsItem to the scene my mouse events are propagated to the QGraphicsItem. However if the QGraphicsItem is added to a QGraphicsItemGroup the mouse event doesn't get sent to the QGraphicsItem. The mouse event occurs in the QGraphicsView, but the item is not getting it. The item/group is visible. All non-grouped items seem to work OK.
    Thank you for any suggestions.

  2. #2
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QtEmbedded 4.70 QGraphicsItemGroup Problem

    Hi,
    I solved this problem by re-implementing QGraphicsItem::sceneEvent(QEvent *event). Now the mousepress/release events are occurring in the custom item.

    Qt Code:
    1. bool MyCustomItem::sceneEvent(QEvent *event)
    2. {
    3. switch (event->type()) {
    4.  
    5. case QEvent::GraphicsSceneMousePress:
    6. mousePressEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
    7. break;
    8.  
    9. case QEvent::GraphicsSceneMouseRelease:
    10. mouseReleaseEvent(static_cast<QGraphicsSceneMouseEvent *>(event));
    11. break;
    12. default:
    13. return (QGraphicsItem::sceneEvent(event));
    14. }
    15. return true;
    16. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QtEmbedded 4.70 QGraphicsItemGroup Problem

    Hi.
    Just so you know I have submitted this as a bug at Qt and it will be patched in 4.72
    http://bugreports.qt.nokia.com/browse/QTBUG-15477

Similar Threads

  1. QGraphicsItemGroup bounding rect problem
    By jonks in forum Qt Programming
    Replies: 2
    Last Post: 28th October 2010, 04:02
  2. The problem of customize QtEmbedded-4.5.0 for arm920t board!
    By jeazh in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 23rd May 2009, 19:35
  3. problem in QGraphicsItemGroup
    By wagmare in forum Qt Programming
    Replies: 1
    Last Post: 14th May 2009, 08:27
  4. Qt and QTEmbedded
    By vishakvkurup in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2008, 10:35
  5. QGraphicsItemGroup problem
    By init2null in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2006, 22:45

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
  •  
Qt is a trademark of The Qt Company.