×

Discussion Board

Results 1 to 7 of 7

Thread: QGraphicsView

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    QGraphicsView

    Hi all

    In my program I have many QGraphicsPixmapItem items, which are movable (setting the ItemIsMovable). How to make the view auto-scrolling, so that when a user tries to move item out the viewport, it will automatically scroll in the right direction? Any suggestions?

    Thanks ahead

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QGraphicsView

    Listen for mouse events for the scene and change QGraphicsView::sceneRect appropriately.

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    Re: QGraphicsView

    Any source code to test?

  4. #4
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QGraphicsView

    The code is too simple to do any prototype testing before implementation.

  5. #5
    Registered User
    Join Date
    Sep 2010
    Posts
    3

    Re: QGraphicsView

    Have you ever noticed a "QPainter is not active" on Qt 4.7? Every time I move item out the viewport, I get error warning in QtDesigner saying "QPainter.<some_qpainter_method>: QPainter is not active, aborting"

  6. #6
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

  7. #7
    Registered User
    Join Date
    Oct 2009
    Posts
    90

    Re: QGraphicsView

    You can try with QGraphicsView::ensureVisible and QGraphicsView::fitInView also.

Similar Threads

  1. QgraphicsView after scale.
    By Estel in forum Qt
    Replies: 2
    Last Post: 2010-04-20, 12:31
  2. How to drag on QGraphicsView frame
    By wudelei in forum Qt
    Replies: 7
    Last Post: 2010-04-16, 09:44
  3. scrolling in QGraphicsView
    By rkurvakat in forum Nokia N9
    Replies: 5
    Last Post: 2010-04-08, 16:14
  4. Fingerscrolling in QGraphicsView framework
    By kleimola in forum Nokia N9
    Replies: 14
    Last Post: 2010-02-13, 11:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •