24 #include <QAbstractItemView>
34 #include "../vmisc/vabstractapplication.h"
35 #include "../vmisc/vcommonsettings.h"
38 # define PDFTOPS "pdftops.exe"
40 # define PDFTOPS "pdftops"
54 setEditable (
false );
68 this->blockSignals(
true);
73 addItem(v.first, QVariant(
static_cast<int>(v.second)));
76 setMaxVisibleItems(count);
78 this->view()->setTextElideMode(Qt::ElideNone);
80 this->blockSignals(
false);
99 setCurrentIndex(findData(QVariant(
static_cast<int>(format))));
101 if (currentIndex()!= count() -1 )
182 #if defined(Q_OS_WIN) || defined(Q_OS_OSX)
184 proc.start(
qApp->applicationDirPath() + QLatin1String(
"/")+
PDFTOPS, QStringList());
186 proc.start(
PDFTOPS, QStringList());
189 if (proc.waitForStarted(15000) && (proc.waitForFinished(15000) || proc.state() == QProcess::NotRunning))
195 qDebug()<<
PDFTOPS<<
"error"<<proc.error()<<proc.errorString();
203 const QString dxfSuffix = QStringLiteral(
"(*.dxf)");
204 const QString dxfFlatFilesStr = tr(
"(flat) files");
205 const QString filesStr = tr(
"files");
210 return QString(
"SVG %1 (*.svg)").arg(filesStr);
212 return QString(
"PDF %1 (*.pdf)").arg(filesStr);
214 return QString(
"PNG %1 (*.png)").arg(filesStr);
216 return QString(
"JPG %1 (*.jpg)").arg(filesStr);
218 return QString(
"BMP %1 (*.bmp)").arg(filesStr);
220 return QString(
"TIF %1 (*.tif)").arg(filesStr);
222 return QString(
"PPM %1 (*.ppm)").arg(filesStr);
224 return "Wavefront OBJ (*.obj)";
226 return QString(
"PS %1 (*.ps)").arg(filesStr);
228 return QString(
"EPS %1 (*.eps)").arg(filesStr);
230 return QString(
"AutoCAD DXF R10 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
232 return QString(
"AutoCAD DXF R11/12 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
234 return QString(
"AutoCAD DXF R13 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
236 return QString(
"AutoCAD DXF R14 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
238 return QString(
"AutoCAD DXF 2000 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
240 return QString(
"AutoCAD DXF 2004 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
242 return QString(
"AutoCAD DXF 2007 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
244 return QString(
"AutoCAD DXF 2010 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
246 return QString(
"AutoCAD DXF 2013 %1 %2").arg(dxfFlatFilesStr, dxfSuffix);
248 return QString(
"AutoCAD DXF R10 AAMA %1 %2").arg(filesStr, dxfSuffix);
250 return QString(
"AutoCAD DXF R11/12 AAMA %1 %2").arg(filesStr, dxfSuffix);
252 return QString(
"AutoCAD DXF R13 AAMA %1 %2").arg(filesStr, dxfSuffix);
254 return QString(
"AutoCAD DXF R14 AAMA %1 %2").arg(filesStr, dxfSuffix);
256 return QString(
"AutoCAD DXF 2000 AAMA %1 %2").arg(filesStr, dxfSuffix);
258 return QString(
"AutoCAD DXF 2004 AAMA %1 %2").arg(filesStr, dxfSuffix);
260 return QString(
"AutoCAD DXF 2007 AAMA %1 %2").arg(filesStr, dxfSuffix);
262 return QString(
"AutoCAD DXF 2010 AAMA %1 %2").arg(filesStr, dxfSuffix);
264 return QString(
"AutoCAD DXF 2013 AAMA %1 %2").arg(filesStr, dxfSuffix);
266 return QString(
"AutoCAD DXF R10 ASTM %1 %2").arg(filesStr, dxfSuffix);
268 return QString(
"AutoCAD DXF R11/12 ASTM %1 %2").arg(filesStr, dxfSuffix);
270 return QString(
"AutoCAD DXF R13 ASTM %1 %2").arg(filesStr, dxfSuffix);
272 return QString(
"AutoCAD DXF R14 ASTM %1 %2").arg(filesStr, dxfSuffix);
274 return QString(
"AutoCAD DXF 2000 ASTM %1 %2").arg(filesStr, dxfSuffix);
276 return QString(
"AutoCAD DXF 2004 ASTM %1 %2").arg(filesStr, dxfSuffix);
278 return QString(
"AutoCAD DXF 2007 ASTM %1 %2").arg(filesStr, dxfSuffix);
280 return QString(
"AutoCAD DXF 2010 ASTM %1 %2").arg(filesStr, dxfSuffix);
282 return QString(
"AutoCAD DXF 2013 ASTM %1 %2").arg(filesStr, dxfSuffix);
284 return QString(
"PDF tiled %1 (*.pdf)").arg(filesStr);
296 out += QLatin1String(
"\t") + v.first + QLatin1String(
" = ") + QString::number(
static_cast<int>(v.second))
297 + QLatin1String(
"\n");
308 QVariant format = itemData(index);
309 if(format != QVariant::Invalid )
319 QString format =
qApp->Settings()->getExportFormat();
321 int index = findText(format);
324 setCurrentIndex(index);