Results 1 to 2 of 2

Thread: ScrollHandDrag in QGraphicsView and mouse events problem

  1. #1
    Join Date
    Nov 2010
    Posts
    31
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default ScrollHandDrag in QGraphicsView and mouse events problem

    Hi,

    I have QGraphicsScene with big image and smaller QGraphicsView, so I need to
    scroll scene in view, so I enabled:
    graphicsView->setDragMode(QGraphicsView::ScrollHandDrag);
    but on this big image there are some smaller images (subclassed from
    QGraphicsPixmapItem) for which I need mouse press/move/release event.
    The problem is:
    When child image receives press event I accept it in order to receive further
    move/release events (which works fine), but then event is not propagated to scene and
    ScrollHandDrag doesn't work.
    I need the scene to be scrolled always, even when I press object that grabs
    mouse events, how to achieve it?
    I suppose I should mess around with eventFilter but I need some hint on how
    this whole idea should work. Please help

    best regards
    Marek

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: ScrollHandDrag in QGraphicsView and mouse events problem

    what happens that you want mouse move on a pixmap item? how should this happen at the same time as graphics view moving?

    I don't think the consequences make sense. I don't think it makes sense at all to do this from a usability perspective.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. QGraphicsView mouse events
    By high_flyer in forum Qt Programming
    Replies: 22
    Last Post: 29th May 2014, 09:03
  2. Replies: 7
    Last Post: 22nd May 2011, 16:01
  3. Replies: 0
    Last Post: 29th December 2010, 16:10
  4. Replies: 5
    Last Post: 27th April 2010, 11:04
  5. QGraphicsView Mouse Events
    By tomf in forum Qt Programming
    Replies: 5
    Last Post: 29th July 2008, 15:03

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.