diff --git a/src/convertworker.cpp b/src/convertworker.cpp index d3b597c..ab682d7 100644 --- a/src/convertworker.cpp +++ b/src/convertworker.cpp @@ -193,9 +193,9 @@ try { qDebug() << "Unsupported paper size" << PaperSize; throw ConvertFailedException(tr("Unsupported paper size")); } - QPair wh = PaperSizes[PaperSize]; - quint32 Width = qRound(wh.first/25.4*HwResX); - quint32 Height = qRound(wh.second/25.4*HwResY); + QSizeF size = PaperSizes[PaperSize]; + quint32 Width = qRound(size.width()/25.4*HwResX); + quint32 Height = qRound(size.height()/25.4*HwResY); qDebug() << "Size is" << Width << "x" << Height; @@ -228,7 +228,7 @@ try { tmpPdfFile.open(); QPdfWriter pdfWriter(tmpPdfFile.fileName()); pdfWriter.setCreator("SeaPrint " SEAPRINT_VERSION); - QPageSize pageSize(QSizeF {wh.first, wh.second}, QPageSize::Millimeter); + QPageSize pageSize(size, QPageSize::Millimeter); pdfWriter.setPageSize(pageSize); pdfWriter.setResolution(HwResX); QPainter painter(&pdfWriter); @@ -452,7 +452,7 @@ try { qDebug() << "Unsupported paper size" << PaperSize; throw ConvertFailedException(tr("Unsupported paper size")); } - QPair wh = PaperSizes[PaperSize]; + QSizeF size = PaperSizes[PaperSize]; QFile inFile(filename); if(!inFile.open(QIODevice::ReadOnly)) @@ -467,7 +467,7 @@ try { QPdfWriter pdfWriter(tmpPdfFile.fileName()); pdfWriter.setCreator("SeaPrint " SEAPRINT_VERSION); - QPageSize pageSize(QSizeF {wh.first, wh.second}, QPageSize::Millimeter); + QPageSize pageSize(size, QPageSize::Millimeter); pdfWriter.setPageSize(pageSize); pdfWriter.setResolution(resolution); diff --git a/src/ippprinter.cpp b/src/ippprinter.cpp index c4d6d5a..94689a4 100644 --- a/src/ippprinter.cpp +++ b/src/ippprinter.cpp @@ -521,8 +521,8 @@ void IppPrinter::print(QJsonObject jobAttrs, QString filename) return; } - int x = PaperSizes[PaperSize].first*100; - int y = PaperSizes[PaperSize].second*100; + int x = PaperSizes[PaperSize].width()*100; + int y = PaperSizes[PaperSize].height()*100; QJsonObject Dimensions = {{"tag", IppMsg::BeginCollection}, diff --git a/src/papersizes.h b/src/papersizes.h index a13fbe7..a37f1a7 100644 --- a/src/papersizes.h +++ b/src/papersizes.h @@ -1,9 +1,9 @@ #ifndef PAPERSIZES_H #define PAPERSIZES_H #include -#include +#include -static QMap> PaperSizes = +static QMap PaperSizes = {{"asme_f_28x40in", {711.20, 1016.00}}, {"iso_2a0_1189x1682mm", {1189.00, 1682.00}}, {"iso_a0_841x1189mm", {841.00, 1189.00}},