Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process
程序员文章站
2022-04-19 16:37:06
...
前言
Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly
当这个问题出现时,我当时一脸懵逼,网上也有相关整理,我看了几篇,得出结论是内存错误。删除了不该删除的,然后再去访问该内存。
在声明的时候 将其QRubberBand* rubberBand = Q_NULLPTR;就可以了。或者构造函数时将其先置空。
代码如下:
#ifndef DEMODOUBLEBUFFWIDGET_H
#define DEMODOUBLEBUFFWIDGET_H
#include <QWidget>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QRubberBand>
class DemoDoubleBuffWidget : public QWidget
{
Q_OBJECT
public:
explicit DemoDoubleBuffWidget(QWidget *parent = nullptr);
signals:
public slots:
protected:
void mousePressEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
// void paintEvent(QPaintEvent*);
private:
QPoint m_startPoint;
QRubberBand* rubberBand = Q_NULLPTR;
};
#endif // DEMODOUBLEBUFFWIDGET_H
#include "demodoublebuffwidget.h"
#include <QPainter>
#include <QDebug>
#include <QRect>
DemoDoubleBuffWidget::DemoDoubleBuffWidget(QWidget *parent)
: QWidget(parent)
{
}
void DemoDoubleBuffWidget::mousePressEvent(QMouseEvent * event)
{
m_startPoint = event->pos();
if (!rubberBand)
rubberBand = new QRubberBand(QRubberBand::Rectangle, this);
rubberBand->setGeometry(QRect(m_startPoint, QSize(10,10)));
rubberBand->show();
}
void DemoDoubleBuffWidget::mouseMoveEvent(QMouseEvent *event)
{
rubberBand->setGeometry(QRect(m_startPoint, event->pos()).normalized());
}
void DemoDoubleBuffWidget::mouseReleaseEvent(QMouseEvent *event)
{
rubberBand->hide();
}
//void DemoDoubleBuffWidget::paintEvent(QPaintEvent *event)
//{
// qDebug() << __FUNCTION__;
//}
上一篇: 'git status' failed with code 128:'
下一篇: axios请求报Uncaught (in promise) Error: Request failed with status code 404
推荐阅读
-
Linux系统Docker启动问题Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service"
-
Linux系统Docker启动问题Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service"
-
解决Qt5.5运行时,出现Error - RtlWerpReportException failed with status code :-1073741823.
-
Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process
-
RtlWerpReportException failed with status code :-1073741823. Will try to launch the process
-
Qt段错误集录(RtlWerpReportException failed with status code :-1073741823. Will try to launch the process)
-
Qt 跨线程初始化变量,程序奔溃(Error - RtlWerpReportException failed with status code :-1073741823.)
-
Qt编译错误Error - RtlWerpReportException failed with status code :-1073741823