Results 1 to 2 of 2

Thread: QGraphicsView::fitInView() problem on Windows

  1. #1
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QGraphicsView::fitInView() problem on Windows

    Hi All,

    I have created application on Windows/Linux using QT 4.5.1 (Open Source). I have used QGraphicsView/Scene architecture to display Graphics items (rectangles etc). I have implemented zoom selection functionaliy. i.e. on Mouse selection, the zoom in the selected area using QGraphicsView::fitInView() function.
    My code works find on Linux but on Windows XP it hangs/slows down after 2 consecutive zoom in operations.
    Please tell me what could be the cause ?? Or any clue.

    Thanks in advance.

    Following is the functions from my code,

    void MyGraphicsView:aintEvent(QPaintEvent * event)
    {
    QPaintEvent *newEvent = new QPaintEvent(event->region().boundingRect());
    QGraphicsView:aintEvent(event);
    delete newEvent;
    }

    void MyGraphicsView::mouseReleaseEvent(QMouseEvent *event)
    {
    QPainterPath path = scene()->selectionArea();
    scene()->clearSelection();
    fitInView(path.boundingRect(), Qt::KeepAspectRatio);
    QGraphicsView::mouseReleaseEvent(event);
    }

  2. #2
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView::fitInView() problem on Windows

    Hello All,

    I have notices that same code works fine on Windows for QT 4.3.1 but not with QT 4.5.1.
    I have also checked the updations/changes of in 4.5.1 version but not able to find much info. But in 4.5.0, QGraphicsView::fitInView() function has been improved for very small viewport. (see the link http://qt.nokia.com/developer/changes/changes-4.5.0

    Can anybody tell me how to solve this problem ?

Similar Threads

  1. Deployment problem on qt 4.5 windows
    By brasio in forum Installation and Deployment
    Replies: 14
    Last Post: 26th June 2010, 00:05
  2. jom / Windows SDK libs linking problem
    By nooky59 in forum Qt Tools
    Replies: 3
    Last Post: 12th November 2009, 14:58
  3. qt deployment problem on windows xp
    By sepp in forum Installation and Deployment
    Replies: 3
    Last Post: 5th July 2007, 11:16
  4. Thread problem with windows
    By vratojr in forum Qt Programming
    Replies: 17
    Last Post: 16th June 2006, 08:34
  5. QProcess problem with windows batch file
    By bood in forum Qt Programming
    Replies: 11
    Last Post: 6th January 2006, 08:08

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.