You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wheeldetect/src/tpMain/qshowimg.cpp

34 lines
816 B
C++

#include "qshowimg.h"
#pragma execution_character_set("utf-8")
QShowImg::QShowImg(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
setWindowFlags(Qt::WindowMaximizeButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint);
connect(ui.m_ChangePic_pb, SIGNAL(clicked()), this, SIGNAL(sgChangeImg()));
connect(ui.m_Close, SIGNAL(clicked()), this, SLOT(close()));
}
QShowImg::~QShowImg()
{
}
Q_SLOT void QShowImg::showImg()
{
}
void QShowImg::setPicPath(QString m_filePath /*= QString()*/)
{
QPixmap m_pix(m_filePath);
if (m_pix.isNull())
ui.label->setText(tr("没有用于检测的背景图,请更换检测背景"));
else
{
double dAspectRatio = m_pix.height()*1.0 /m_pix.width();
double nwidth = 370*1.0/ dAspectRatio;
ui.label->setPixmap(m_pix.scaled(nwidth,370));
}
}