Results 1 to 4 of 4

Thread: QGraphicsView::fitInView()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Location
    Munich
    Posts
    73
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsView::fitInView()

    Anybody knows the implied difference between these pieces of code? Any duplicated updating?
    Thanks.

    Qt Code:
    1. void my_graphicsView::resizeEvent(QResizeEvent *event)
    2. {
    3. setWidth(event->size().width());
    4. setHeight(event->size().height());
    5.  
    6. fitInView(QRectF(0,0,width(),height()),Qt::KeepAsp ectRatioByExpanding);
    7. arrangeNodes();
    8.  
    9. m_scene->setSceneRect(0,0,width(),height());
    10. this->setSceneRect(0,0,width(),height());
    11.  
    12. update();
    13. }
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. void my_graphicsView::resizeEvent(QResizeEvent *event)
    2. {
    3. setWidth(event->size().width());
    4. setHeight(event->size().height());
    5.  
    6. fitInView(QRectF(0,0,width(),height()),Qt::KeepAsp ectRatioByExpanding);
    7. arrangeNodes();
    8.  
    9. m_scene->update(0,0,width(),height());
    10. update();
    11. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 30th March 2011 at 14:26.

Similar Threads

  1. graphicsView.fitInView() :- one axis only ?
    By JackDinn in forum Newbie
    Replies: 6
    Last Post: 21st February 2011, 22:24
  2. QGraphicsView::fitInView() problem on Windows
    By nileshsince1980 in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2009, 04:52
  3. How to don't fitInView a QGraphicsItem
    By jano_alex_es in forum Newbie
    Replies: 2
    Last Post: 26th October 2009, 14:52
  4. fitInView problem at QGraphicsView
    By oguzy in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2008, 23:36
  5. graphics view FitInView problem
    By aamer4yu in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2007, 10:24

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.