46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
//用于有背面检测的提示框
|
|
#include <components/fancyDialog.h>
|
|
#include <qtimer.h>
|
|
|
|
class productDetDoubleCheck : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
fancyWarnWindow* _fancyWarnWindow;
|
|
QTimer* timer;
|
|
productDetDoubleCheck()
|
|
{
|
|
timer = new QTimer(this);
|
|
_fancyWarnWindow = new fancyWarnWindow(fancyWarnWindow::tip, "确认检测产品型号", "",false);
|
|
_fancyWarnWindow->disableHideAfterClicked();
|
|
_fancyWarnWindow->hide();
|
|
QObject::connect(_fancyWarnWindow->continueBtn, &QPushButton::clicked, this, &productDetDoubleCheck::continueClicked);
|
|
|
|
}
|
|
private:
|
|
int productType = 0;
|
|
QString SN;
|
|
public slots:
|
|
void continueClicked()
|
|
{
|
|
//timer->start(10000);
|
|
emit continueClickedSignal(productType, SN);
|
|
_fancyWarnWindow->hide();
|
|
//_fancyWarnWindow->continueBtn->setDisabled(true);
|
|
//QObject::connect(timer, &QTimer::timeout, this, [=]() {_fancyWarnWindow->continueBtn->setEnabled(true); });
|
|
}
|
|
void showAndSetText(int productTypeIn, QString SNin)
|
|
{
|
|
_fancyWarnWindow->show();
|
|
_fancyWarnWindow->setDetailText(QString::fromStdString(_core._appConfig.productDatas[productTypeIn].name));
|
|
productType = productTypeIn;
|
|
SN = SNin;
|
|
}
|
|
void hide()
|
|
{
|
|
_fancyWarnWindow->hide();
|
|
}
|
|
signals:
|
|
void continueClickedSignal(int,QString);
|
|
};
|
|
#pragma once |