Anybody knows the implied difference between these pieces of code? Any duplicated updating?
Thanks.
{
setWidth(event->size().width());
setHeight(event->size().height());
fitInView
(QRectF(0,
0,width
(),height
()),Qt
::KeepAsp ectRatioByExpanding
);
arrangeNodes();
m_scene->setSceneRect(0,0,width(),height());
this->setSceneRect(0,0,width(),height());
update();
}
void my_graphicsView::resizeEvent(QResizeEvent *event)
{
setWidth(event->size().width());
setHeight(event->size().height());
fitInView(QRectF(0,0,width(),height()),Qt::KeepAsp ectRatioByExpanding);
arrangeNodes();
m_scene->setSceneRect(0,0,width(),height());
this->setSceneRect(0,0,width(),height());
update();
}
To copy to clipboard, switch view to plain text mode
{
setWidth(event->size().width());
setHeight(event->size().height());
fitInView
(QRectF(0,
0,width
(),height
()),Qt
::KeepAsp ectRatioByExpanding
);
arrangeNodes();
m_scene->update(0,0,width(),height());
update();
}
void my_graphicsView::resizeEvent(QResizeEvent *event)
{
setWidth(event->size().width());
setHeight(event->size().height());
fitInView(QRectF(0,0,width(),height()),Qt::KeepAsp ectRatioByExpanding);
arrangeNodes();
m_scene->update(0,0,width(),height());
update();
}
To copy to clipboard, switch view to plain text mode
Bookmarks