|
|
|
|
|
#include "ValueCheckDlg.h"
|
|
|
|
|
|
#include "qstandarditemmodel.h"
|
|
|
|
|
|
#include "qmessagebox.h"
|
|
|
|
|
|
#include "qfontmetrics.h"
|
|
|
|
|
|
#include <QDir>
|
|
|
|
|
|
#include <QSettings>
|
|
|
|
|
|
#include "QSqlRecord"
|
|
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
|
|
ValueCheckDlg::ValueCheckDlg(QWidget *parent)
|
|
|
|
|
|
: QWidget(parent)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui.setupUi(this);
|
|
|
|
|
|
|
|
|
|
|
|
m_ViewImg = new lpImgViewer;
|
|
|
|
|
|
connect(ui.m_pbCheck, SIGNAL(clicked()), this, SLOT(onCheckOutData()));
|
|
|
|
|
|
connect(ui.Prev_checkShengchang, SIGNAL(clicked()), this, SLOT(onChenckButton()));
|
|
|
|
|
|
connect(ui.Next_checkShengchang, SIGNAL(clicked()), this, SLOT(onChenckButton()));
|
|
|
|
|
|
connect(ui.m_pbCount, SIGNAL(clicked()), this, SLOT(onChenckButton()));
|
|
|
|
|
|
setWindowIcon(QIcon(":/leaper/app.png"));
|
|
|
|
|
|
pShowName_label = ui.check_fileName;
|
|
|
|
|
|
pShowName_label->clear();
|
|
|
|
|
|
|
|
|
|
|
|
check_showImg_label = ui.check_showImg_label;
|
|
|
|
|
|
check_showImg_label->clear();
|
|
|
|
|
|
QGridLayout *pGrid = new QGridLayout(this);
|
|
|
|
|
|
pGrid->addWidget(m_ViewImg);
|
|
|
|
|
|
check_showImg_label->setLayout(pGrid);
|
|
|
|
|
|
|
|
|
|
|
|
m_tableModel = new QStandardItemModel;
|
|
|
|
|
|
tableView = ui.tableView;
|
|
|
|
|
|
connect(tableView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(onTBUI_ItemClick(const QModelIndex &)));
|
|
|
|
|
|
tableView->setModel(m_tableModel);
|
|
|
|
|
|
textBrowser = ui.textBrowser;
|
|
|
|
|
|
|
|
|
|
|
|
pStartTimeEdit = ui.dateTimeEdit_start;
|
|
|
|
|
|
pEndTimeEdit = ui.dateTimeEdit_end;
|
|
|
|
|
|
QDateTime nDateTime = QDateTime::currentDateTime();
|
|
|
|
|
|
nDateTime.setTime(QTime(0, 0, 0));
|
|
|
|
|
|
pStartTimeEdit->setDateTime(nDateTime);
|
|
|
|
|
|
pEndTimeEdit->setDateTime(QDateTime::currentDateTime());
|
|
|
|
|
|
setPageShow(0, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ValueCheckDlg::~ValueCheckDlg()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (m_tableModel)
|
|
|
|
|
|
{
|
|
|
|
|
|
delete m_tableModel;
|
|
|
|
|
|
m_tableModel = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (m_ViewImg) {
|
|
|
|
|
|
delete m_ViewImg;
|
|
|
|
|
|
m_ViewImg = NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::setDBPtr(class DetectDataDB *ptr)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_db = ptr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::initParam(QMap<QString, TimeStruct> timetable, QStringList names)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui.comboBox_Model->clear();
|
|
|
|
|
|
ui.comboBox_Model->addItem(tr("ȫ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
if (!names.contains("NG"))
|
|
|
|
|
|
ui.comboBox_Model->addItem(tr("NG"));
|
|
|
|
|
|
ui.comboBox_Model->addItems(names);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::createHeader()
|
|
|
|
|
|
{
|
|
|
|
|
|
QStringList listStr;
|
|
|
|
|
|
listStr.append(QObject::tr("ʱ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD>ͺ<EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD>Ƕ<EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("Բ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("ִ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬"));
|
|
|
|
|
|
m_tableModel->setHorizontalHeaderLabels(listStr);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::updateModelShowLog(QSqlQuery &sql)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_tableModel->clear();
|
|
|
|
|
|
m_strMap.clear();
|
|
|
|
|
|
createHeader();
|
|
|
|
|
|
tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
|
|
|
|
|
tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
|
|
|
|
|
tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
|
|
tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);//<2F><><EFBFBD><EFBFBD>Ӧ<EFBFBD>п<EFBFBD>
|
|
|
|
|
|
int nIndex = 0;
|
|
|
|
|
|
while (sql.next())
|
|
|
|
|
|
{
|
|
|
|
|
|
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʋ<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>Ӧ<EFBFBD>IJ<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
QString time = sql.value("create_time").toString();
|
|
|
|
|
|
QString strModelName = sql.value("modeName").toString();
|
|
|
|
|
|
double dAngle = sql.value("angle").toDouble();
|
|
|
|
|
|
double dScore = sql.value("score").toDouble();
|
|
|
|
|
|
QString strCenter = sql.value("center").toString();
|
|
|
|
|
|
int errorType = sql.value("errorCode").toInt();
|
|
|
|
|
|
double runtime = sql.value("runtime").toDouble();
|
|
|
|
|
|
QString strFilename = sql.value("ImagePath").toString();//ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼƬ<CDBC><C6AC>·<EFBFBD><C2B7><EFBFBD><EFBFBD>
|
|
|
|
|
|
QString runState = sql.value("runState").toString();
|
|
|
|
|
|
/*
|
|
|
|
|
|
listStr.append(QObject::tr("ʱ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD>ͺ<EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD>Ƕ<EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("Բ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("ִ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>"));
|
|
|
|
|
|
listStr.append(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬"));
|
|
|
|
|
|
*/
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 0, new QStandardItem(time));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 1, new QStandardItem(strModelName));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 2, new QStandardItem(QString("%1").arg(dAngle)));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 3, new QStandardItem(QString("%1").arg(dScore)));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 4, new QStandardItem(strCenter));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 5, new QStandardItem(QString("%1").arg(errorType)));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 6, new QStandardItem(QString("%1").arg(runtime)));
|
|
|
|
|
|
m_tableModel->setItem(nIndex, 7, new QStandardItem(runState));
|
|
|
|
|
|
m_strMap.insert(time, strFilename);
|
|
|
|
|
|
pShowName_label->setText(strFilename);
|
|
|
|
|
|
nIndex++;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ui.showNum_Label_Checkdata->setText(QString(QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ%1<><31><EFBFBD><EFBFBD>¼")).arg(nIndex));
|
|
|
|
|
|
tableView->setModel(m_tableModel);
|
|
|
|
|
|
|
|
|
|
|
|
int page = nPrevNum / getLimitNumber();
|
|
|
|
|
|
int totalPage = nTotlaNumber / getLimitNumber();
|
|
|
|
|
|
setPageShow(page + 1, totalPage + 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int ValueCheckDlg::getLimitNumber()
|
|
|
|
|
|
{
|
|
|
|
|
|
int num = ui.LineNumber_checkShengchang->text().toInt();
|
|
|
|
|
|
if (num > 1)
|
|
|
|
|
|
return num;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ui.LineNumber_checkShengchang->setText("50");
|
|
|
|
|
|
return 50;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
int ValueCheckDlg::getTotalNumber()
|
|
|
|
|
|
{
|
|
|
|
|
|
QString startTime = pStartTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz");
|
|
|
|
|
|
QString endTime = pEndTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz");
|
|
|
|
|
|
QString modelName = ui.comboBox_Model->currentText();
|
|
|
|
|
|
QString strSql = QString();
|
|
|
|
|
|
if (modelName == QObject::tr("ȫ<EFBFBD><EFBFBD>"))
|
|
|
|
|
|
strSql = QString("select count(uid) from valueTable where create_time >'%1' and create_time <'%2' ").arg(startTime).arg(endTime);
|
|
|
|
|
|
else
|
|
|
|
|
|
strSql = QString("select count(uid) from valueTable where create_time >'%1' and create_time <'%2' and modeName == '%3'").arg(startTime).arg(endTime).arg(modelName);
|
|
|
|
|
|
|
|
|
|
|
|
QSqlQuery sqlquery;
|
|
|
|
|
|
m_db->checkoutData(strSql, sqlquery);
|
|
|
|
|
|
int totalNumber = 0;
|
|
|
|
|
|
while (sqlquery.next())
|
|
|
|
|
|
{
|
|
|
|
|
|
QSqlRecord record = sqlquery.record();
|
|
|
|
|
|
QString fieldName = record.fieldName(0);
|
|
|
|
|
|
QString num = sqlquery.value(0).toString();
|
|
|
|
|
|
totalNumber = num.toInt();
|
|
|
|
|
|
// /*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʋ<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8><EFBFBD><EFBFBD>Ӧ<EFBFBD>IJ<EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>*/
|
|
|
|
|
|
}
|
|
|
|
|
|
return totalNumber;
|
|
|
|
|
|
}
|
|
|
|
|
|
Q_SLOT void ValueCheckDlg::onCheckOutData()
|
|
|
|
|
|
{
|
|
|
|
|
|
nTotlaNumber = 0;
|
|
|
|
|
|
nPrevNum = 0;
|
|
|
|
|
|
int limitNum = getLimitNumber();
|
|
|
|
|
|
nTotlaNumber = getTotalNumber();
|
|
|
|
|
|
|
|
|
|
|
|
onCheckOutData(limitNum, nPrevNum);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::onCheckOutData(int nLimitNum, int nPrenum)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString startTime = pStartTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz");
|
|
|
|
|
|
QString endTime = pEndTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz");
|
|
|
|
|
|
QString modelName = ui.comboBox_Model->currentText();
|
|
|
|
|
|
QString strSql = QString();
|
|
|
|
|
|
if (modelName == QObject::tr("ȫ<EFBFBD><EFBFBD>"))
|
|
|
|
|
|
strSql = QString("select * from valueTable where create_time >'%1' and create_time <'%2' LIMIT %3 OFFSET %4 ").arg(startTime).arg(endTime).arg(nLimitNum).arg(nPrenum);
|
|
|
|
|
|
else
|
|
|
|
|
|
strSql = QString("select * from valueTable where create_time >'%1' and create_time <'%2' and modeName == '%3' LIMIT %4 OFFSET %5 ").arg(startTime).arg(endTime).arg(modelName).arg(nLimitNum).arg(nPrenum);
|
|
|
|
|
|
QSqlQuery sqlquery;
|
|
|
|
|
|
m_db->checkoutData(strSql, sqlquery);
|
|
|
|
|
|
updateModelShowLog(sqlquery);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Q_SLOT void ValueCheckDlg::onChenckButton()
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strObjName = sender()->objectName();
|
|
|
|
|
|
if (strObjName == "Next_checkShengchang")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (nTotlaNumber <= 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
if (nPrevNum > nTotlaNumber)
|
|
|
|
|
|
return;
|
|
|
|
|
|
nPrevNum += getLimitNumber();
|
|
|
|
|
|
if (nPrevNum > nTotlaNumber)
|
|
|
|
|
|
{
|
|
|
|
|
|
nPrevNum -= getLimitNumber();
|
|
|
|
|
|
QMessageBox infobox(QMessageBox::Information, QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), QObject::tr("<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һҳ<EFBFBD><EFBFBD>"), QMessageBox::Ok, NULL);
|
|
|
|
|
|
infobox.setWindowIcon(QIcon(":/leaper/app.png"));
|
|
|
|
|
|
infobox.setButtonText(QMessageBox::Ok, QString(QObject::tr("ȷ<EFBFBD><EFBFBD>")));
|
|
|
|
|
|
infobox.exec();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
onCheckOutData(getLimitNumber(), nPrevNum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strObjName == "Prev_checkShengchang")
|
|
|
|
|
|
{
|
|
|
|
|
|
if (nTotlaNumber <= 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
if (nPrevNum < 0)
|
|
|
|
|
|
return;
|
|
|
|
|
|
nPrevNum -= getLimitNumber();
|
|
|
|
|
|
if (nPrevNum < 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
nPrevNum = 0;
|
|
|
|
|
|
QMessageBox infobox(QMessageBox::Information, QObject::tr("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), QObject::tr("<EFBFBD>Ѿ<EFBFBD><EFBFBD>ǵ<EFBFBD>һҳ<EFBFBD><EFBFBD>"), QMessageBox::Ok, NULL);
|
|
|
|
|
|
infobox.setWindowIcon(QIcon(":/leaper/app.png"));
|
|
|
|
|
|
infobox.setButtonText(QMessageBox::Ok, QString(QObject::tr("ȷ<EFBFBD><EFBFBD>")));
|
|
|
|
|
|
infobox.exec();
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
onCheckOutData(getLimitNumber(), nPrevNum);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (strObjName == "m_pbCount")
|
|
|
|
|
|
{
|
|
|
|
|
|
QString startTime = pStartTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz");
|
|
|
|
|
|
QString endTime = pEndTimeEdit->dateTime().toString("yyyy-MM-dd hh:mm:ss zzz");
|
|
|
|
|
|
QString modelName = ui.comboBox_Model->currentText();
|
|
|
|
|
|
QString strSql = QString();
|
|
|
|
|
|
if (modelName == QObject::tr("ȫ<EFBFBD><EFBFBD>"))
|
|
|
|
|
|
strSql = QString("select errorCode,count(uid) from valueTable where create_time >'%1' and create_time <'%2' group by errorCode order by errorCode").arg(startTime).arg(endTime);
|
|
|
|
|
|
else
|
|
|
|
|
|
strSql = QString("select errorCode,count(uid) from valueTable where create_time >'%1' and create_time <'%2' and modeName == '%3' group by errorCode order by errorCode").arg(startTime).arg(endTime).arg(modelName);
|
|
|
|
|
|
|
|
|
|
|
|
QSqlQuery sqlquery;
|
|
|
|
|
|
m_db->checkoutData(strSql, sqlquery);
|
|
|
|
|
|
QMap<QString, int> nCountMap;
|
|
|
|
|
|
|
|
|
|
|
|
while (sqlquery.next())
|
|
|
|
|
|
{
|
|
|
|
|
|
QSqlRecord record = sqlquery.record();
|
|
|
|
|
|
QString fieldName = record.fieldName(0);
|
|
|
|
|
|
QString nType = sqlquery.value(0).toString();
|
|
|
|
|
|
int count = sqlquery.value(1).toInt();
|
|
|
|
|
|
nCountMap.insert(nType, count);
|
|
|
|
|
|
}
|
|
|
|
|
|
int TotalNumber = 0;
|
|
|
|
|
|
int ErrorNumber = 0;
|
|
|
|
|
|
textBrowser->clear();
|
|
|
|
|
|
for (QMap<QString, int>::iterator its = nCountMap.begin(); its != nCountMap.end(); ++its)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strKey = its.key();
|
|
|
|
|
|
int nValue = nCountMap.value(strKey);
|
|
|
|
|
|
QString str;
|
|
|
|
|
|
if (strKey != "0")
|
|
|
|
|
|
str = QString("errorType:%1 Sum:%2;").arg(strKey).arg(nValue);
|
|
|
|
|
|
else
|
|
|
|
|
|
str = QString("goodType Sum:%2;").arg(nValue);
|
|
|
|
|
|
TotalNumber += nValue;
|
|
|
|
|
|
if (strKey != "0")
|
|
|
|
|
|
{
|
|
|
|
|
|
ErrorNumber += nValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
textBrowser->append(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
QString strEnd = QString("ErrorNumber:%1\nTotalNumber:%2").arg(ErrorNumber).arg(TotalNumber);
|
|
|
|
|
|
textBrowser->append(strEnd);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::setPageShow(int page, int totalPage)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString str = QString(QObject::tr("<EFBFBD><EFBFBD>%1ҳ <20><>%2ҳ")).arg(page).arg(totalPage);
|
|
|
|
|
|
ui.showPage_Label_Checkdata->setText(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ValueCheckDlg::changeEvent(QEvent *event)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (event->type() == QEvent::LanguageChange)
|
|
|
|
|
|
{
|
|
|
|
|
|
ui.retranslateUi(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Q_SLOT void ValueCheckDlg::onTBUI_ItemClick(const QModelIndex & index)
|
|
|
|
|
|
{
|
|
|
|
|
|
QModelIndex nindex = m_tableModel->index(index.row(), 0);
|
|
|
|
|
|
QString str = nindex.data().toString();
|
|
|
|
|
|
if (m_strMap.size() > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
QString strFileName = m_strMap.value(str);
|
|
|
|
|
|
|
|
|
|
|
|
if (check_showImg_label)
|
|
|
|
|
|
{
|
|
|
|
|
|
QImage npixmap;
|
|
|
|
|
|
QString appPath = QApplication::applicationDirPath();
|
|
|
|
|
|
npixmap.load(strFileName);
|
|
|
|
|
|
m_ViewImg->setImg(npixmap);
|
|
|
|
|
|
if (!npixmap.isNull()) {
|
|
|
|
|
|
if (pShowName_label)
|
|
|
|
|
|
{
|
|
|
|
|
|
QFontMetrics fontMetrics(this->font());
|
|
|
|
|
|
int fontSize = fontMetrics.width(strFileName);
|
|
|
|
|
|
QString str = strFileName;
|
|
|
|
|
|
if (fontSize > pShowName_label->width())
|
|
|
|
|
|
{
|
|
|
|
|
|
str = fontMetrics.elidedText(strFileName, Qt::ElideRight, pShowName_label->width());
|
|
|
|
|
|
}
|
|
|
|
|
|
pShowName_label->setText(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else {
|
|
|
|
|
|
if (pShowName_label) {
|
|
|
|
|
|
pShowName_label->setText(QObject::tr("<EFBFBD><EFBFBD>ͼƬ(<28><>ͼƬ<CDBC>ѹ<EFBFBD><D1B9><EFBFBD>/<2F>ѱ<EFBFBD>ɾ<EFBFBD><C9BE>)"));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Q_SLOT void ValueCheckDlg::onSlowPixmap(QSqlQuery sql)
|
|
|
|
|
|
{
|
|
|
|
|
|
static bool nFlag = false;
|
|
|
|
|
|
if (nFlag == true)
|
|
|
|
|
|
return;
|
|
|
|
|
|
nFlag = true;
|
|
|
|
|
|
|
|
|
|
|
|
sql.next();
|
|
|
|
|
|
double dHight = sql.value("hight").toDouble();
|
|
|
|
|
|
QByteArray pic = sql.value("pic").toByteArray();
|
|
|
|
|
|
QImage img = QImage::fromData(pic);
|
|
|
|
|
|
QSize s = img.size();
|
|
|
|
|
|
{
|
|
|
|
|
|
int dhight = img.height();
|
|
|
|
|
|
int dwidth = img.width();
|
|
|
|
|
|
double nRate = img.width()*1.0 / img.height();
|
|
|
|
|
|
int scarew = 150;
|
|
|
|
|
|
int scareh = 150 * 1.0 / nRate;
|
|
|
|
|
|
|
|
|
|
|
|
if (scareh > 150)
|
|
|
|
|
|
{
|
|
|
|
|
|
scarew = 150;
|
|
|
|
|
|
scareh = 150 * 1.0 / nRate;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (check_showImg_label)
|
|
|
|
|
|
{
|
|
|
|
|
|
m_ViewImg->setImg(img);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//label_6->setPixmap(m_Pix.scaled(WHEEL_PIC_SIZE, WHEEL_PIC_SIZE));
|
|
|
|
|
|
nFlag = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|