diff options
author | mread <qt-info@nokia.com> | 2011-10-10 11:58:12 (GMT) |
---|---|---|
committer | mread <qt-info@nokia.com> | 2011-10-10 12:23:08 (GMT) |
commit | ae620eb773a5fd217de4766fc829e51417cb9e70 (patch) | |
tree | 8f1468cdc0f7fbb82a934b7370cc6a1b9aae5df2 /src/gui/kernel | |
parent | 22d475e1ef32875c4933b2bb4c2830cb1bdd3266 (diff) | |
download | Qt-ae620eb773a5fd217de4766fc829e51417cb9e70.zip Qt-ae620eb773a5fd217de4766fc829e51417cb9e70.tar.gz Qt-ae620eb773a5fd217de4766fc829e51417cb9e70.tar.bz2 |
Converting from double to qreal in gui
There were a number of places in QtGui where doubles were used in
expressions due to the use of floating point constants in the
code. Many of these constants are now constructed as qreal, removing
the use of double operations where unneeded.
These changes have been limited to constants that have exactly the same
value whether double or float, to ensure that precision errors are not
introduced.
This should not affect any of the desktop platforms where qreal is
double. On Symbian, where qreal is float, appropriate autotests have
been run.
Task-number: QTBUG-4894
Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qtooltip.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/kernel/qtooltip.cpp b/src/gui/kernel/qtooltip.cpp index f880243..178e7b1 100644 --- a/src/gui/kernel/qtooltip.cpp +++ b/src/gui/kernel/qtooltip.cpp @@ -184,7 +184,7 @@ QTipLabel::QTipLabel(const QString &text, QWidget *w) setAlignment(Qt::AlignLeft); setIndent(1); qApp->installEventFilter(this); - setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / 255.0); + setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / qreal(255.0)); setMouseTracking(true); fadingOut = false; reuseTip(text); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 0aa1dfa..e015f5f 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11049,7 +11049,7 @@ bool QWidget::testAttribute_helper(Qt::WidgetAttribute attribute) const qreal QWidget::windowOpacity() const { Q_D(const QWidget); - return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / 255. : 1.0; + return (isWindow() && d->maybeTopData()) ? d->maybeTopData()->opacity / qreal(255.) : qreal(1.0); } void QWidget::setWindowOpacity(qreal opacity) |