I draw few objects and connections between them. All objects are subclassed from QGraphicsWidget.
If I scroll view so that part of grey rectangle is not visible - then all lines/connections are gone. Lines/Connections are set as children to those rectangles.
The same situation with lines between rectangles. There's one big QGraphicsWidget set as parent for them and used to expand view - this big widget is a parent for lines/connections between rectangles. And they disappear too.
For me it looks like some kind clipping.
That's how I paint rectangles (smaller one have different colour) .
cGray = cGray.light();
painter->setBrush(brush);
painter->drawRect(0,0,size().width(),size().height());
QColor cGray(Qt::gray);
cGray = cGray.light();
QBrush brush(cGray);
painter->setBrush(brush);
painter->drawRect(0,0,size().width(),size().height());
To copy to clipboard, switch view to plain text mode
And connections/lines.
stPen.setWidth(2);
painter->setPen(stPen);
painter->drawLines(m_vPathLines);
QPen stPen;
stPen.setWidth(2);
painter->setPen(stPen);
painter->drawLines(m_vPathLines);
To copy to clipboard, switch view to plain text mode
Params set for QGraphicsView
m_ptrSceneView->setInteractive(true);
m_ptrSceneView->setScene(&m_RP3Scene);
m_ptrSceneView
->setViewportUpdateMode
(QGraphicsView::FullViewportUpdate);
m_ptrSceneView = new QGraphicsView;
m_ptrSceneView->setInteractive(true);
m_ptrSceneView->setDragMode(QGraphicsView::ScrollHandDrag);
m_ptrSceneView->setScene(&m_RP3Scene);
m_ptrSceneView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
To copy to clipboard, switch view to plain text mode
Could some one tell me - how to set this Graphics Environment, so lines/connections won't disappear when I scroll?
Bookmarks