summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpdf.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-14 11:01:37 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-14 11:03:51 (GMT)
commitb770651f19741907cd415ea9ad6e087cb32cc948 (patch)
treeecc163e8b33af66454b84ca7f9159d11d6f0cd91 /src/gui/painting/qpdf.cpp
parent51ce8a80acebc67ef09d506d89a2ee1972377877 (diff)
downloadQt-b770651f19741907cd415ea9ad6e087cb32cc948.zip
Qt-b770651f19741907cd415ea9ad6e087cb32cc948.tar.gz
Qt-b770651f19741907cd415ea9ad6e087cb32cc948.tar.bz2
QVariant: added toFloat and toReal
Made better use of qreal all over the place. We were previously using QVariant::toDouble a lot. That is triggering unnecessary conversions between float and double on embedded. Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/painting/qpdf.cpp')
-rw-r--r--src/gui/painting/qpdf.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 3f5643e..9b3b289 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1471,10 +1471,10 @@ void QPdfBaseEngine::setProperty(PrintEnginePropertyKey key, const QVariant &val
{
QList<QVariant> margins(value.toList());
Q_ASSERT(margins.size() == 4);
- d->leftMargin = margins.at(0).toDouble();
- d->topMargin = margins.at(1).toDouble();
- d->rightMargin = margins.at(2).toDouble();
- d->bottomMargin = margins.at(3).toDouble();
+ d->leftMargin = margins.at(0).toReal();
+ d->topMargin = margins.at(1).toReal();
+ d->rightMargin = margins.at(2).toReal();
+ d->bottomMargin = margins.at(3).toReal();
d->hasCustomPageMargins = true;
break;
}
@@ -1576,7 +1576,7 @@ QVariant QPdfBaseEngine::property(PrintEnginePropertyKey key) const
margins << d->leftMargin << d->topMargin
<< d->rightMargin << d->bottomMargin;
} else {
- const int defaultMargin = 10; // ~3.5 mm
+ const qreal defaultMargin = 10; // ~3.5 mm
margins << defaultMargin << defaultMargin
<< defaultMargin << defaultMargin;
}