#include "IdentifyForm.h" #include "ui_IdentifyForm.h" IdentifyForm::IdentifyForm(QWidget *parent) : QWidget(parent) , ui(new Ui::IdentifyForm) { ui->setupUi(this); // 初始化更新界面的定时器 // 每秒执行一次 connect(TimeCounterUtil::getInstance().clockCounter, &QTimer::timeout, this, &IdentifyForm::updateDateAndTime); TimeCounterUtil::getInstance().clockCounter->start(1000); } IdentifyForm::~IdentifyForm() { delete ui; } void IdentifyForm::drawIrisImageOnFrame(QImage image) { // 只在识别界面才显示画面 if (ui->wgtStacked->currentIndex() == 0) { ui->labelVideo->setPixmap(QPixmap::fromImage(image)); } } void IdentifyForm::updateDateAndTime() { ui->labelTime->setText(QDateTime::currentDateTime().toString("yyyy-MM-dd dddd HH:mm:ss")); }