|
|
|
@ -86,7 +86,7 @@ void lpImageCaliUI4P::showEvent(QShowEvent *event)
|
|
|
|
if (m_srcImgView)
|
|
|
|
if (m_srcImgView)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_srcImgView->onClearAllROI();
|
|
|
|
m_srcImgView->onClearAllROI();
|
|
|
|
QString DstPath = QApplication::applicationDirPath() + "\\user\\StandImage.png";
|
|
|
|
QString DstPath = QApplication::applicationDirPath() + "\\user\\StandImage.jpg";
|
|
|
|
QImage img;
|
|
|
|
QImage img;
|
|
|
|
img.load(DstPath);
|
|
|
|
img.load(DstPath);
|
|
|
|
|
|
|
|
|
|
|
|
@ -120,10 +120,10 @@ Q_SLOT void lpImageCaliUI4P::onButtonClicked()
|
|
|
|
QString strObj = sender()->objectName();
|
|
|
|
QString strObj = sender()->objectName();
|
|
|
|
if (strObj == "m_pbLoadImg")
|
|
|
|
if (strObj == "m_pbLoadImg")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Ñ¡Ôñ±ê¶¨Í¼"), "/home/jana", tr("Image Files (*.png *.jpg *.bmp)"));
|
|
|
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Ñ¡Ôñ±ê¶¨Í¼"), lpGlobalConfig::instance()->m_SaveImgDirPath + "/data/", tr("Image Files (*.png *.jpg *.bmp)"));
|
|
|
|
if (!fileName.isEmpty())
|
|
|
|
if (!fileName.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QString DstPath = QApplication::applicationDirPath() + "\\user\\StandImage.png";
|
|
|
|
QString DstPath = QApplication::applicationDirPath() + "\\user\\StandImage.jpg";
|
|
|
|
QString sourcePath = fileName;
|
|
|
|
QString sourcePath = fileName;
|
|
|
|
DstPath.replace("\\", "/");
|
|
|
|
DstPath.replace("\\", "/");
|
|
|
|
if (sourcePath == DstPath) {
|
|
|
|
if (sourcePath == DstPath) {
|
|
|
|
@ -135,13 +135,14 @@ Q_SLOT void lpImageCaliUI4P::onButtonClicked()
|
|
|
|
if (exist) {
|
|
|
|
if (exist) {
|
|
|
|
createfile->remove(DstPath);
|
|
|
|
createfile->remove(DstPath);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!QFile::copy(sourcePath, DstPath)) {
|
|
|
|
// if (!QFile::copy(sourcePath, DstPath)) {
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
QImage img;
|
|
|
|
QImage img;
|
|
|
|
img.load(fileName);
|
|
|
|
img.load(fileName);
|
|
|
|
if (m_srcImgView) {
|
|
|
|
if (m_srcImgView) {
|
|
|
|
m_srcImgView->setImg(img);
|
|
|
|
m_srcImgView->setImg(img);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
img.save(DstPath);
|
|
|
|
delete createfile;
|
|
|
|
delete createfile;
|
|
|
|
createfile = nullptr;
|
|
|
|
createfile = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|