解决停止扫描后,提示是否继续的对话框有时显示不出来按钮的问题
This commit is contained in:
parent
4ce0b0cba1
commit
801b302e58
|
@ -86,6 +86,11 @@ QString DeviceUser::GetName()
|
|||
return QString(devName);
|
||||
}
|
||||
|
||||
HGResult DeviceUser::Clear()
|
||||
{
|
||||
return HGTwain_DisableDS(m_twainDS);
|
||||
}
|
||||
|
||||
HGResult DeviceUser::ShowSettingDlg()
|
||||
{
|
||||
return HGTwain_EnableDSUIOnly(m_twainDS, (HWND)m_wnd->winId(), DSEventFunc, this);
|
||||
|
@ -158,7 +163,6 @@ void HGAPI DeviceUser::DSEventFunc(HGTwainDS ds, HGUInt event, HGPointer param)
|
|||
DeviceUser* p = (DeviceUser*)param;
|
||||
if (HGTWAIN_EVENT_TYPE_SCANFINISHED == event)
|
||||
{
|
||||
HGTwain_DisableDS(p->m_twainDS);
|
||||
emit p->scanFinishEvent();
|
||||
}
|
||||
else if (HGTWAIN_EVENT_TYPE_WORKING == event)
|
||||
|
@ -167,8 +171,7 @@ void HGAPI DeviceUser::DSEventFunc(HGTwainDS ds, HGUInt event, HGPointer param)
|
|||
}
|
||||
else if (HGTWAIN_EVENT_TYPE_CLOSEDSREQ == event)
|
||||
{
|
||||
HGTwain_DisableDS(p->m_twainDS);
|
||||
emit p->closeDSReq();
|
||||
emit p->clearRes();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -291,6 +294,11 @@ QString DeviceUser::GetName()
|
|||
return QString(devName);
|
||||
}
|
||||
|
||||
HGResult DeviceUser::Clear()
|
||||
{
|
||||
return HGBASE_ERR_OK;
|
||||
}
|
||||
|
||||
HGResult DeviceUser::ShowSettingDlg()
|
||||
{
|
||||
return HGSane_ShowDeviceSettingDlg(m_saneDev, m_wnd);
|
||||
|
|
|
@ -39,6 +39,7 @@ public:
|
|||
HGResult Close();
|
||||
// 获取设备名字
|
||||
QString GetName();
|
||||
HGResult Clear();
|
||||
// 弹出配置对话框
|
||||
HGResult ShowSettingDlg();
|
||||
// 弹出扫描对话框
|
||||
|
@ -61,7 +62,7 @@ signals:
|
|||
void newImage(void *image);
|
||||
void scanFinishEvent();
|
||||
void scanWorkingEvent();
|
||||
void closeDSReq();
|
||||
void clearRes();
|
||||
|
||||
private:
|
||||
QWidget *m_wnd;
|
||||
|
@ -104,6 +105,7 @@ public:
|
|||
HGResult Close();
|
||||
// 获取设备名字
|
||||
QString GetName();
|
||||
HGResult Clear();
|
||||
// 弹出配置对话框
|
||||
HGResult ShowSettingDlg();
|
||||
// 弹出扫描对话框
|
||||
|
@ -128,6 +130,7 @@ signals:
|
|||
void abnormalImage(void *image, HGUInt *result);
|
||||
void scanFinishEvent();
|
||||
void scanWorkingEvent();
|
||||
void clearRes();
|
||||
|
||||
private:
|
||||
QWidget *m_wnd;
|
||||
|
|
|
@ -376,7 +376,7 @@ MainWindow::MainWindow(const QString& appLang, QWidget *parent)
|
|||
connect(m_devUser, SIGNAL(abnormalImage(void*,HGUInt*)), this, SLOT(on_abnormalImage(void*,HGUInt*)), Qt::BlockingQueuedConnection);
|
||||
connect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()), Qt::QueuedConnection);
|
||||
connect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()), Qt::QueuedConnection);
|
||||
connect(m_devUser, SIGNAL(closeDSReq()), this, SLOT(on_closeDSReq()), Qt::QueuedConnection);
|
||||
connect(m_devUser, SIGNAL(clearRes()), this, SLOT(on_clearRes()), Qt::QueuedConnection);
|
||||
|
||||
#if !defined(HG_CMP_MSC)
|
||||
checkRollerLife();
|
||||
|
@ -434,7 +434,7 @@ MainWindow::~MainWindow()
|
|||
disconnect(m_devUser, SIGNAL(abnormalImage(void*,HGUInt*)), this, SLOT(on_abnormalImage(void*,HGUInt*)));
|
||||
disconnect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()));
|
||||
disconnect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()));
|
||||
disconnect(m_devUser, SIGNAL(closeDSReq()), this, SLOT(on_closeDSReq()));
|
||||
disconnect(m_devUser, SIGNAL(clearRes()), this, SLOT(on_clearRes()));
|
||||
delete m_devUser;
|
||||
m_devUser = nullptr;
|
||||
}
|
||||
|
@ -1345,6 +1345,8 @@ void MainWindow::on_scanWorkingEvent()
|
|||
|
||||
void MainWindow::on_scanFinishEvent()
|
||||
{
|
||||
m_devUser->Clear();
|
||||
|
||||
HGBase_EnterLock(m_lockPreviewImage);
|
||||
HGBase_DestroyImage(m_previewImage);
|
||||
m_previewImage = nullptr;
|
||||
|
@ -1519,8 +1521,9 @@ void MainWindow::on_scanFinishEvent()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_closeDSReq()
|
||||
void MainWindow::on_clearRes()
|
||||
{
|
||||
m_devUser->Clear();
|
||||
m_dsEnabled = false;
|
||||
}
|
||||
|
||||
|
@ -4279,7 +4282,7 @@ void MainWindow::deleteDevUser()
|
|||
disconnect(m_devUser, SIGNAL(abnormalImage(void*,HGUInt*)), this, SLOT(on_abnormalImage(void*,HGUInt*)));
|
||||
disconnect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()));
|
||||
disconnect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()));
|
||||
disconnect(m_devUser, SIGNAL(closeDSReq()), this, SLOT(on_closeDSReq()));
|
||||
disconnect(m_devUser, SIGNAL(clearRes()), this, SLOT(on_clearRes()));
|
||||
m_devUser->Logout();
|
||||
delete m_devUser;
|
||||
m_devUser = nullptr;
|
||||
|
@ -4543,7 +4546,7 @@ void MainWindow::on_act_selectDevice_triggered()
|
|||
disconnect(m_devUser, SIGNAL(abnormalImage(void*,HGUInt*)), this, SLOT(on_abnormalImage(void*,HGUInt*)));
|
||||
disconnect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()));
|
||||
disconnect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()));
|
||||
disconnect(m_devUser, SIGNAL(closeDSReq()), this, SLOT(on_closeDSReq()));
|
||||
disconnect(m_devUser, SIGNAL(clearRes()), this, SLOT(on_clearRes()));
|
||||
m_devUser->Logout();
|
||||
delete m_devUser;
|
||||
m_devUser = nullptr;
|
||||
|
@ -4566,7 +4569,7 @@ void MainWindow::on_act_selectDevice_triggered()
|
|||
connect(m_devUser, SIGNAL(abnormalImage(void*,HGUInt*)), this, SLOT(on_abnormalImage(void*,HGUInt*)), Qt::BlockingQueuedConnection);
|
||||
connect(m_devUser, SIGNAL(scanWorkingEvent()), this, SLOT(on_scanWorkingEvent()), Qt::QueuedConnection);
|
||||
connect(m_devUser, SIGNAL(scanFinishEvent()), this, SLOT(on_scanFinishEvent()), Qt::QueuedConnection);
|
||||
connect(m_devUser, SIGNAL(closeDSReq()), this, SLOT(on_closeDSReq()), Qt::QueuedConnection);
|
||||
connect(m_devUser, SIGNAL(clearRes()), this, SLOT(on_clearRes()), Qt::QueuedConnection);
|
||||
#if !defined(HG_CMP_MSC)
|
||||
checkRollerLife();
|
||||
#endif
|
||||
|
|
|
@ -146,7 +146,7 @@ private slots:
|
|||
void on_abnormalImage(void *image, HGUInt *result);
|
||||
void on_scanFinishEvent();
|
||||
void on_scanWorkingEvent();
|
||||
void on_closeDSReq();
|
||||
void on_clearRes();
|
||||
void on_m_pbtn_push_clicked();
|
||||
void on_dialog_sideBar_applyToImage(HGImage img, int brightness, int contrast, double gamma, bool enhanceText);
|
||||
void on_dialog_sideBar_finish(bool ok);
|
||||
|
|
Loading…
Reference in New Issue