zoomCursor = nullptr;
}
+void QtViewer_ViewPort::resetForeground()
+{
+ for (std::shared_ptr<QtViewer_PainterObject> obj : foregroundObjects)
+ obj.reset();
+
+ foregroundObjects.clear();
+}
+
void QtViewer_ViewPort::drawForeground(QPainter *painter, const QRectF &rect)
{
Q_UNUSED(rect);
- for (QtViewer_PainterObject* obj : foregroundObjects)
+ for (std::shared_ptr<QtViewer_PainterObject> obj : foregroundObjects)
obj->draw(painter);
}
QImage dumpView(bool theWholeScene = false, QSizeF theSize = QSizeF());
bool dumpViewToFormat(const QString& fileName, const QString& format);
- void addForegroundObject(QtViewer_PainterObject* obj) { foregroundObjects.append(obj); }
+ void addForegroundObject( std::shared_ptr<QtViewer_PainterObject> obj) { foregroundObjects.append(obj); }
+ void resetForeground();
signals:
void vpMouseEvent(QMouseEvent*);
QPoint previousPos;
QCursor* zoomCursor;
- QList<QtViewer_PainterObject*> foregroundObjects;
+ QList<std::shared_ptr<QtViewer_PainterObject> > foregroundObjects;
};
#endif