Hello, author
The following is the code snippet where the exception occurred, as identified through my WinDBG dump file analysis
void QCustomPlot::replot(QCustomPlot::RefreshPriority refreshPriority)
{
if (refreshPriority == QCustomPlot::rpQueuedReplot)
{
if (!mReplotQueued)
{
mReplotQueued = true;
QTimer::singleShot(0, this, SLOT(replot()));
}
return;
}An exception occurred during the return statement; below is the code I was executing.
connect(ui->tab1_openCameraBtn_2, &QPushButton::clicked, this, [this]() {
QCustomPlot* customPlot = new QCustomPlot();
customPlot->show();
});I can confirm that the integration process of QCustomPlot into the project is correct, and the QtPrintSupport module has been properly included. To clearly demonstrate the issue, I connected the signal-slot mechanism via the connect function to ensure the QCustomPlot object is generated after program initialization.
When compiling with Visual Studio 2019 (C++20 language standard) and Qt 6.6.0 MSVC2019_64, the lambda expression executes correctly. However, after packaging the application using windeployqt and EnigmaVB, clicking the button triggers a crash.
How should I troubleshoot this problem?
I apologize for the inconvenience and thank you for your assistance.
ps:When I create a new project in the same way, it runs normally in the same environment. This is quite strange. As you can see, I'm merely calling a lambda function. If I promote a QWidget to QCustomPlot in the UI file, it also causes the program to crash.