Results 1 to 2 of 2

Thread: Problem with QGraphicsView.

  1. #1
    Join Date
    Dec 2006
    Posts
    17
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Problem with QGraphicsView.

    In main window application, when i use scrollbar to scroll to some GraphicsView area of a scene, iam facing one issue.
    When the application is minimized and then maximized, the scrollbar does not stay at the last view position. Rather it shifts to the left and top extremes.

    Iam are not sure how to overcome this problem. I want the restore to retain the last Scene coordinates.

    Thanx

  2. #2
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Problem with QGraphicsView.

    Have you tried recentering them manually? You could do something like this:

    Qt Code:
    1. /* QPointF */ lastCenterPoint = view->mapToScene(view->rect().center());
    2. // minimize...
    3.  
    4.  
    5. // restore...
    6. view->scrollTo(lastCenterPoint);
    To copy to clipboard, switch view to plain text mode 

    Or, you could simply store the scrollbar values before and restore them after the minimize. I guess you have multiple options here.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

Similar Threads

  1. QGraphicsView scrolling problem with 4.3.0
    By hb in forum Qt Programming
    Replies: 8
    Last Post: 30th August 2007, 22:18
  2. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30
  3. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  4. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.