Skip to content

Commit

Permalink
OriginItem paint event is called even before we set visible false
Browse files Browse the repository at this point in the history
For such OriginItem shape we don't have GraphicsView so check for NULL.
  • Loading branch information
adeas31 committed Nov 18, 2020
1 parent dccc1e8 commit 09c5b61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OMEdit/OMEditLIB/Element/CornerItem.cpp
Expand Up @@ -422,8 +422,8 @@ void OriginItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option
{
Q_UNUSED(option);
Q_UNUSED(widget);
if ((mpShapeAnnotation && mpShapeAnnotation->getGraphicsView()->isRenderingLibraryPixmap())
|| (mpComponent && mpComponent->getGraphicsView()->isRenderingLibraryPixmap())) {
if ((mpShapeAnnotation && mpShapeAnnotation->getGraphicsView() && mpShapeAnnotation->getGraphicsView()->isRenderingLibraryPixmap())
|| (mpComponent && mpComponent->getGraphicsView() && mpComponent->getGraphicsView()->isRenderingLibraryPixmap())) {
return;
}
painter->setRenderHint(QPainter::Antialiasing);
Expand Down

0 comments on commit 09c5b61

Please sign in to comment.