备份
This commit is contained in:
@@ -17,6 +17,8 @@ public:
|
||||
QPushButton* closeBtn = new QPushButton(this);
|
||||
fancyButtonText* okBtn = new fancyButtonText(120, 40, "OK", "继续");
|
||||
fancyButtonText* ngBtn = new fancyButtonText(120, 40, "NG", "继续");
|
||||
QMutex mutex;
|
||||
QQueue< QPixmap>imgqueue;
|
||||
imageDoubleCheckQdialog()
|
||||
{
|
||||
QPalette paletteWhite, paletteRed, paletteGreen;
|
||||
@@ -81,21 +83,21 @@ public:
|
||||
menuBarLayoutRight->addWidget(closeBtn);
|
||||
|
||||
QObject::connect(closeBtn, &QPushButton::clicked, this, &QDialog::close);
|
||||
|
||||
|
||||
QHBoxLayout* imageViewLayout = new QHBoxLayout();
|
||||
imageViewLayout->addWidget(_ImageWidgetManager);
|
||||
|
||||
_ImageWidgetManager->createViewer("");
|
||||
_ImageWidgetManager->disableAllSwitchBtn();
|
||||
|
||||
|
||||
QHBoxLayout* okngBtnLayout = new QHBoxLayout();
|
||||
okngBtnLayout->addWidget(okBtn);
|
||||
okngBtnLayout->addWidget(ngBtn);
|
||||
|
||||
QObject::connect(okBtn, &QPushButton::clicked, this, &QDialog::close);
|
||||
QObject::connect(ngBtn, &QPushButton::clicked, this, &QDialog::close);
|
||||
QObject::connect(okBtn, &QPushButton::clicked, this, [=]() {emit okSignal(); });
|
||||
QObject::connect(ngBtn, &QPushButton::clicked, this, [=]() {emit ngSignal(); });
|
||||
//QObject::connect(okBtn, &QPushButton::clicked, this, &QDialog::close);
|
||||
//QObject::connect(ngBtn, &QPushButton::clicked, this, &QDialog::close);
|
||||
QObject::connect(okBtn, &QPushButton::clicked, this, [=]() {pressOK(); });
|
||||
QObject::connect(ngBtn, &QPushButton::clicked, this, [=]() {pressNG(); });
|
||||
|
||||
layout->addWidget(menuBarWidget, 0, 0);
|
||||
layout->addLayout(imageViewLayout, 1, 0);
|
||||
@@ -105,13 +107,57 @@ public:
|
||||
}
|
||||
void showAndSetImg(QPixmap img)
|
||||
{
|
||||
_ImageWidgetManager->showImg(img, imgWidgetShowType::imgWidgetOri, 0);
|
||||
this->show();
|
||||
mutex.lock();
|
||||
std::cout << isShowing<<"-" << imgqueue.size()<< std::endl;
|
||||
if (isShowing == false && imgqueue.size() == 0)
|
||||
{
|
||||
_ImageWidgetManager->showImg(img, imgWidgetShowType::imgWidgetOri, 0);
|
||||
this->show();
|
||||
isShowing = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
imgqueue.enqueue(img);
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
signals:
|
||||
void okSignal();
|
||||
void ngSignal();
|
||||
private:
|
||||
void pressOK()
|
||||
{
|
||||
mutex.lock();
|
||||
emit okSignal();
|
||||
if (imgqueue.size() > 0)
|
||||
{
|
||||
QPixmap img = imgqueue.dequeue();
|
||||
_ImageWidgetManager->showImg(img, imgWidgetShowType::imgWidgetOri, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
isShowing = false;
|
||||
close();
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
void pressNG()
|
||||
{
|
||||
mutex.lock();
|
||||
emit ngSignal();
|
||||
if (imgqueue.size() > 0)
|
||||
{
|
||||
QPixmap img = imgqueue.dequeue();
|
||||
_ImageWidgetManager->showImg(img, imgWidgetShowType::imgWidgetOri, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
isShowing = false;
|
||||
close();
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
bool isShowing = false;
|
||||
bool isMoving = false;
|
||||
bool isResizing = false;
|
||||
int minWidth = 720, minHeight = 480;
|
||||
|
||||
Reference in New Issue
Block a user