解决第二次扫描进度指示器对象未重新创建导致崩溃的问题

This commit is contained in:
luoliangyi 2023-10-20 16:05:50 +08:00
parent 8775e35d8f
commit 7ac69fea99
5 changed files with 10 additions and 7 deletions

View File

@ -54,7 +54,7 @@ win32 {
LIBS += -lgdi32 -lgdiplus -ldbghelp -luser32 -ladvapi32
LIBS += -L$$PWD/../../build/$${MY_OS}/$${OEM_NAME}/$${MY_ARCH}/$${MY_CONFIGURE} -l$${OEM_PREFIX}Base -l$${OEM_PREFIX}ImgFmt \
-l$${OEM_PREFIX}ImgProc -l$${OEM_PREFIX}Version
LIBS += -L$$PWD/../../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsane
LIBS += -L$$PWD/../../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsanexy
# sane.dll
LIBS += -L$$PWD/../../../../release/win/$${MY_ARCH}/OEM/$${OEM_NAME}

View File

@ -53,7 +53,7 @@ win32 {
DEF_FILE = HGScannerLib.def
LIBS += -lgdi32 -lgdiplus -ldbghelp
LIBS += -L$$PWD/../../build/$${MY_OS}/$${OEM_NAME}/$${MY_ARCH}/$${MY_CONFIGURE} -l$${OEM_PREFIX}Base -l$${OEM_PREFIX}ImgFmt -l$${OEM_PREFIX}ImgProc
LIBS += -L$$PWD/../../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsane
LIBS += -L$$PWD/../../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsanexy
}
unix {

View File

@ -60,7 +60,7 @@ win32 {
LIBS += -lgdi32 -lgdiplus -ldbghelp -lws2_32 -lShell32 -lUser32 -lwldap32 -lAdvapi32
LIBS += -L$$PWD/../../build/$${MY_OS}/$${OEM_NAME}/$${MY_ARCH}/$${MY_CONFIGURE} -l$${OEM_PREFIX}Base -l$${OEM_PREFIX}ImgFmt -l$${OEM_PREFIX}ImgProc
LIBS += -L$$PWD/../../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsane
LIBS += -L$$PWD/../../../../sdk/lib/win/$${MY_ARCH}/OEM/$${OEM_NAME} -lsanexy
INCLUDEPATH += $$PWD/../../../third_party/libzip/$${MY_OS}/include
INCLUDEPATH += $$PWD/../../../third_party/libcurl/$${MY_OS}/include
LIBS += $$PWD/../../../third_party/zlib/$${MY_OS}/lib/$${MY_ARCH}/zlib.lib

View File

@ -337,8 +337,9 @@ void Manager::on_createSettingUi(bool qt)
m_settingUiCallback(r);
};
if (m_settingUi == nullptr)
m_settingUi = new hg_settingdialog(this, m_device, &m_api, m_with_scan, m_devName.c_str(), scanner_cfg_, close_prog, qParent);
if (m_settingUi != nullptr)
delete m_settingUi;
m_settingUi = new hg_settingdialog(this, m_device, &m_api, m_with_scan, m_devName.c_str(), scanner_cfg_, close_prog, qParent);
m_settingUi->setModal(true);
m_settingUi->show();
}
@ -367,8 +368,9 @@ void Manager::on_createProgressUi(bool qt)
if(r == UI_RESULT_CLOSE_NORMAL)
m_progressUiCallback = std::function<void(ui_result)>();
};
if (m_progressUi == nullptr)
m_progressUi = new Dialog_progress_ui(this, close_prog, m_notify, qParent);
if (m_progressUi != nullptr)
delete m_progressUi;
m_progressUi = new Dialog_progress_ui(this, close_prog, m_notify, qParent);
m_progressUi->setModal(true);
m_progressUi->show();
#ifdef HG_CMP_MSC

View File

@ -18,6 +18,7 @@ Dialog_progress_ui::Dialog_progress_ui(class Manager *mgr, std::function<void (u
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
#if defined(HG_CMP_MSC)
setWindowFlags(Qt::SubWindow | Qt::Popup | Qt::WindowStaysOnTopHint);
#else