以下变量需要写NULL,不能写nullptr,否则会崩溃或编译不过
HTuple m_hLabelID; //QLabel控件句柄
HTuple m_hHalconID; //Halcon窗口显示句柄
HTuple m_hLabelID; //QLabel控件句柄
HTuple m_hHalconID; //Halcon窗口显示句柄
m_hHalconID = NULL;
//下面一定要写成NULL,不能写nullptr
if(m_hHalconID != NULL)
{
//如果有图像先清空图像
HalconCpp::DetachBackgroundFromWindow(m_hHalconID);
}
if(m_hHalconID != NULL)
{
HalconCpp::SetWindowExtents(m_hHalconID, 0, 0, ui->label_show->width(), ui->label_show->height());
}