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.
66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
#include "QCameraConfigUI.h"
|
|
#include <QFileDialog>
|
|
#include "baseStruct.h"
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
QCameraConfigUI::QCameraConfigUI(QWidget *parent)
|
|
: QDialog(parent)
|
|
{
|
|
ui.setupUi(this);
|
|
connect(ui.m_pbApply, SIGNAL(clicked()), this, SLOT(onButtonClicked()));//保存
|
|
connect(ui.m_pbClose, SIGNAL(clicked()), this, SLOT(onButtonClicked()));//关闭
|
|
connect(ui.m_pbSelectDir, SIGNAL(clicked()), this, SLOT(onButtonClicked()));//配置虚拟文件夹路径
|
|
|
|
ui.comboBox->clear();
|
|
for (QMap<emTpDeviceType, QString>::const_iterator it = gCameraNamesMap.begin(); it != gCameraNamesMap.end(); ++it)
|
|
{
|
|
QString strVal = *it;
|
|
int key = it.key();
|
|
ui.comboBox->addItem(strVal, key);
|
|
}
|
|
}
|
|
|
|
QCameraConfigUI::~QCameraConfigUI()
|
|
{
|
|
}
|
|
|
|
Q_SLOT void QCameraConfigUI::onButtonClicked()
|
|
{
|
|
QString strObj = sender()->objectName();
|
|
if ("m_pbApply" == strObj)
|
|
{
|
|
QDialog::accept();
|
|
}
|
|
else if ("m_pbClose" == strObj)
|
|
{
|
|
QDialog::reject();
|
|
}
|
|
else if ("m_pbSelectDir" == strObj)
|
|
{
|
|
QString strPath = QFileDialog::getExistingDirectory(this);
|
|
ui.lineEdit_3->setText(strPath);
|
|
}
|
|
}
|
|
|
|
tagCamInfo QCameraConfigUI::getNewCamInfo()
|
|
{
|
|
int ntype = ui.comboBox->currentData().toInt();
|
|
QString serial = ui.lineEdit->text();//serial
|
|
QString showName = ui.lineEdit_2->text();//show name
|
|
QString filePath = ui.lineEdit_3->text();//path
|
|
tagCamInfo camInfo;
|
|
camInfo.nType = ntype;
|
|
camInfo.serialNo = serial;
|
|
camInfo.showName = showName;
|
|
camInfo.loadPath = filePath;
|
|
return camInfo;
|
|
}
|
|
|
|
void QCameraConfigUI::changeEvent(QEvent *event)
|
|
{
|
|
if (event->type() == QEvent::LanguageChange)
|
|
{
|
|
ui.retranslateUi(this);
|
|
}
|
|
}
|