Originally Posted by
MarekR22
I do call prepareGeometryChange() when I setRect() in child item (QGraphicsRectItem) inside mouseMoveEvent.
I get some progress. I found, if in resizeEvent of QGraphicsView, code I has the blinking problem, code II doesn't. I am confused why this can cause such effect. resizeEvent is called only once when going to FullScreen mode, and never reached afterwards when I drag the edge of childItem. I can post the code of the resizeEvent:
code I:
{
setWidth(event->size().width());
setHeight(event->size().height());
fitInView
(QRectF(0,
0,width
(),height
()),Qt
::KeepAspectRatioByExpanding);
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::KeepAspectRatioByExpanding);
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
code II:
{
setWidth(event->size().width());
setHeight(event->size().height());
fitInView
(QRectF(0,
0,width
(),height
()),Qt
::KeepAspectRatioByExpanding);
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::KeepAspectRatioByExpanding);
arrangeNodes();
m_scene->update(0,0,width(),height());
update();
}
To copy to clipboard, switch view to plain text mode
Bookmarks