Results 1 to 20 of 32

Thread: Zooming scene Rect(Qt bug?)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #16
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    40
    Thanked 8 Times in 4 Posts

    Default Re: Zooming scene Rect(Qt bug?)

    Hi,

    I have na idea where the problem lays(I suppose that wysote suggested it at the beginning in the first place, but didn't understand the idea). I belive the problem is connected with scene/view sizes.
    Here is the information about the view/scene sizes after construction and their sizes while doing the first zooming.

    Just after construction:
    Qt Code:
    1. qDebug()<<m_view->size().height()<<m_view->size().width();
    2. m_scene->setSceneRect(-50,50,m_view->width(),m_view->height());
    3. qDebug()<<m_scene->sceneRect().height()<<m_scene->sceneRect().width();
    To copy to clipboard, switch view to plain text mode 

    100 30
    100 30
    Before doing the first zooming :
    Qt Code:
    1. qDebug()<<m_view->size().height()<<m_view->size().width();
    2. qDebug()<<m_scene->sceneRect().height()<<m_scene->sceneRect().width();
    To copy to clipboard, switch view to plain text mode 

    660 1224
    100 30
    I would like to have the same coordinate system in the scene and the view. It looks like because of the scene/view size different the zooming is incorrect. Am I right?

    Because the first zooming rectangle(from my example zooming) has coordinates:
    -285 157
    215 157
    -285 -143
    215 -143
    and it's bigger than the scene, so I zoom the whole(the center).
    Ok...I belive this is the problem, but yet do not know how to fix it ?

    Any help appreciated.


    Maverick
    Last edited by maverick_pol; 25th August 2007 at 14:04.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

Similar Threads

  1. Creating a scene from piece of another scene
    By maverick_pol in forum Qt Programming
    Replies: 3
    Last Post: 23rd August 2007, 18:51
  2. Zooming scene
    By maverick_pol in forum Qt Programming
    Replies: 12
    Last Post: 2nd August 2007, 18:37
  3. How to use QGraphicsView and Scene right ...
    By Mike in forum Qt Programming
    Replies: 6
    Last Post: 22nd January 2007, 09:51

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.