Compare commits

..

No commits in common. "182284c60f0cd58a1986ec75e6928ca051ea64e1" and "d3cf84f479845ba3f809355bde6b382801f823fc" have entirely different histories.

1 changed files with 0 additions and 6 deletions

View File

@ -3,7 +3,6 @@
#include <QInputDialog> #include <QInputDialog>
#include <QFileDialog> #include <QFileDialog>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QMessagebox>
ElementPoolWidget::ElementPoolWidget(QWidget* parent) ElementPoolWidget::ElementPoolWidget(QWidget* parent)
: QWidget(parent) : QWidget(parent)
@ -126,12 +125,7 @@ void ElementPoolWidget::popMenu(const QPoint& pos)
{ {
menu->addAction(QString::fromLocal8Bit("添加元素从svg导入"), this, [this]() { menu->addAction(QString::fromLocal8Bit("添加元素从svg导入"), this, [this]() {
QString filePath = QFileDialog::getOpenFileName(this, QString::fromLocal8Bit("打开文件"), "", "SVG Files (*.svg)"); QString filePath = QFileDialog::getOpenFileName(this, QString::fromLocal8Bit("打开文件"), "", "SVG Files (*.svg)");
filePath = filePath.trimmed();
QFileInfo fileInfo(filePath); QFileInfo fileInfo(filePath);
if (!fileInfo.exists() || !fileInfo.isFile()) {
QMessageBox::warning(this, tr("Error"), QString::fromLocal8Bit("请选择Svg文件"));
return;
}
QString fileName = fileInfo.fileName(); QString fileName = fileInfo.fileName();
qDebug() << fileName << " " << filePath; qDebug() << fileName << " " << filePath;
this->elementManager->createSimpleElement(fileName, filePath); this->elementManager->createSimpleElement(fileName, filePath);