Access violation QRubberBand
Solved
General and Desktop
-
This code:
void DSSImageView::mousePressEvent(QMouseEvent* e) { rubberBandOrigin = e->pos(); if (!rubberBand) rubberBand = new QRubberBand(QRubberBand::Rectangle, this); rubberBand->setGeometry(QRect(rubberBandOrigin, QSize())); rubberBand->show(); emit Image_mousePressEvent(e); }
ends up with an access violation with a this->data value of 0xfdfdfdfd00000147 attempting to execute the following code in qwidget.h at line 768
inline Qt::WindowType QWidget::windowType() const { return static_cast<Qt::WindowType>(int(data->window_flags & Qt::WindowType_Mask)); }
-
@Perdrix
Dunno, you sure yourrubberBand
stays around, e.g. hasn't beendelete
d? Most likely would be an existingrubberBand
pointing to rubbish or deleted widget? Also, assuming no threads, this will executeImage_mousePressEvent(e)
directly, maybe that has a problem?In any case, it may not solve, but what you should show here is the stack trace during debug (it's in one of the debugger windows) at the time of the access violation, depending on content that might help narrow down. It may go all the way back to a particular line in your code.