Commit 3802257ab32f62e2491053428145f3ab578d312a

Authored by Jose Pablo Castro Valverde
Committed by David Graeff
1 parent 8eec0c4a

Make openhantek compile with Qt5 (drop Qt4 support)

openhantek/OpenHantek.pro
... ... @@ -17,6 +17,7 @@ CONFIG += \
17 17 warn_on \
18 18 qt
19 19 QT += opengl
  20 +QT += printsupport
20 21 LIBS += -lfftw3
21 22  
22 23 # Source files
... ...
openhantek/src/dsowidget.cpp
... ... @@ -445,7 +445,6 @@ bool DsoWidget::exportAs() {
445 445 QStringList filters;
446 446 filters
447 447 << tr("Portable Document Format (*.pdf)")
448   - << tr("PostScript (*.ps)")
449 448 << tr("Image (*.png *.xpm *.jpg)")
450 449 << tr("Comma-Separated Values (*.csv)");
451 450  
... ... @@ -457,7 +456,7 @@ bool DsoWidget::exportAs() {
457 456  
458 457 Exporter exporter(this->settings, this->dataAnalyzer, static_cast<QWidget *>(this->parent()));
459 458 exporter.setFilename(fileDialog.selectedFiles().first());
460   - exporter.setFormat((ExportFormat) (EXPORT_FORMAT_PDF + filters.indexOf(fileDialog.selectedFilter())));
  459 + exporter.setFormat((ExportFormat) (EXPORT_FORMAT_PDF + filters.indexOf(fileDialog.selectedNameFilter())));
461 460  
462 461 return exporter.doExport();
463 462 }
... ...
openhantek/src/exporter.cpp
... ... @@ -99,7 +99,7 @@ bool Exporter::doExport() {
99 99 else {
100 100 // Configure the QPrinter
101 101 static_cast<QPrinter *>(paintDevice)->setOutputFileName(this->filename);
102   - static_cast<QPrinter *>(paintDevice)->setOutputFormat((this->format == EXPORT_FORMAT_PDF) ? QPrinter::PdfFormat : QPrinter::PostScriptFormat);
  102 + static_cast<QPrinter *>(paintDevice)->setOutputFormat((this->format == EXPORT_FORMAT_PDF) ? QPrinter::PdfFormat : QPrinter::NativeFormat);
103 103 }
104 104 }
105 105 else {
... ...
openhantek/src/exporter.h
... ... @@ -40,7 +40,7 @@ class DataAnalyzer;
40 40 /// \brief Possible file formats for the export.
41 41 enum ExportFormat {
42 42 EXPORT_FORMAT_PRINTER,
43   - EXPORT_FORMAT_PDF, EXPORT_FORMAT_PS,
  43 + EXPORT_FORMAT_PDF,
44 44 EXPORT_FORMAT_IMAGE,
45 45 EXPORT_FORMAT_CSV
46 46 };
... ...