解决按键扫描工具主界面最小化后扫描,弹窗未显示的问题BUG 1261
This commit is contained in:
parent
eba82113f1
commit
15be006325
|
@ -1266,6 +1266,27 @@ void MainWindow::timerEvent(QTimerEvent *e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::changeEvent(QEvent *e)
|
||||||
|
{
|
||||||
|
if (QEvent::WindowStateChange == e->type())
|
||||||
|
{
|
||||||
|
QWindowStateChangeEvent *event = dynamic_cast<QWindowStateChangeEvent*>(e);
|
||||||
|
if (nullptr != event)
|
||||||
|
{
|
||||||
|
if (this->isMinimized())
|
||||||
|
{
|
||||||
|
if (m_dlgScanInfo->isVisible())
|
||||||
|
{
|
||||||
|
m_dlgScanInfo->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
||||||
|
m_dlgScanInfo->show();
|
||||||
|
m_dlgScanInfo->activateWindow();
|
||||||
|
m_dlgScanInfo->raise();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_deviceArrive(QString devName)
|
void MainWindow::on_deviceArrive(QString devName)
|
||||||
{
|
{
|
||||||
if (devName.contains("306") || devName.contains("307") || devName.contains("358") || devName.contains("9225"))
|
if (devName.contains("306") || devName.contains("307") || devName.contains("358") || devName.contains("9225"))
|
||||||
|
|
|
@ -50,6 +50,7 @@ private:
|
||||||
protected:
|
protected:
|
||||||
virtual void closeEvent(QCloseEvent *e) override;
|
virtual void closeEvent(QCloseEvent *e) override;
|
||||||
virtual void timerEvent(QTimerEvent* e) override;
|
virtual void timerEvent(QTimerEvent* e) override;
|
||||||
|
virtual void changeEvent(QEvent* e) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void deviceArrive(QString devName);
|
void deviceArrive(QString devName);
|
||||||
|
|
Loading…
Reference in New Issue