aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/detailsbutton.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-08-29 13:18:41 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-09-08 10:33:25 +0200
commit847f10e9ccc8c3541782a790e04c85c6b4c701da (patch)
treee59ebac8dfb77c88d8e5540855836ca79a9a7a91 /src/libs/utils/detailsbutton.cpp
parent6f58e5b798e368e6254cc837e489bd8fd8f066e9 (diff)
Remove Qt version checks.
Qt 5.3 is the minimum requirement these days. Remove all fallback code from sources and project files. Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src/libs/utils/detailsbutton.cpp')
-rw-r--r--src/libs/utils/detailsbutton.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/src/libs/utils/detailsbutton.cpp b/src/libs/utils/detailsbutton.cpp
index 3d33296d262..5dd1b36fd72 100644
--- a/src/libs/utils/detailsbutton.cpp
+++ b/src/libs/utils/detailsbutton.cpp
@@ -32,15 +32,12 @@
#include <utils/hostosinfo.h>
#include <QGraphicsOpacityEffect>
+#include <QGuiApplication>
#include <QPropertyAnimation>
#include <QPaintEvent>
#include <QPainter>
#include <QStyleOption>
-#if QT_VERSION >= 0x050100
-#include <QGuiApplication>
-#endif
-
using namespace Utils;
FadingWidget::FadingWidget(QWidget *parent) :
@@ -127,19 +124,12 @@ void DetailsButton::paintEvent(QPaintEvent *e)
if (!HostOsInfo::isMacHost() && !isDown() && m_fader > 0)
p.fillRect(rect().adjusted(1, 1, -2, -2), QColor(255, 255, 255, int(m_fader*180)));
- qreal checkedPixmapRatio = 1.0;
- qreal uncheckedPixmapRatio = 1.0;
-#if QT_VERSION >= 0x050100
- checkedPixmapRatio = m_checkedPixmap.devicePixelRatio();
- uncheckedPixmapRatio = m_uncheckedPixmap.devicePixelRatio();
-#endif
-
if (isChecked()) {
- if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / checkedPixmapRatio != contentsRect().size())
+ if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / m_checkedPixmap.devicePixelRatio() != contentsRect().size())
m_checkedPixmap = cacheRendering(contentsRect().size(), true);
p.drawPixmap(contentsRect(), m_checkedPixmap);
} else {
- if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / uncheckedPixmapRatio != contentsRect().size())
+ if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / m_uncheckedPixmap.devicePixelRatio() != contentsRect().size())
m_uncheckedPixmap = cacheRendering(contentsRect().size(), false);
p.drawPixmap(contentsRect(), m_uncheckedPixmap);
}
@@ -156,14 +146,9 @@ QPixmap DetailsButton::cacheRendering(const QSize &size, bool checked)
lg.setCoordinateMode(QGradient::ObjectBoundingMode);
lg.setFinalStop(0, 1);
- qreal pixelRatio = 1.0;
-#if QT_VERSION >= 0x050100
- pixelRatio = devicePixelRatio();
-#endif
+ const qreal pixelRatio = devicePixelRatio();
QPixmap pixmap(size * pixelRatio);
-#if QT_VERSION >= 0x050100
pixmap.setDevicePixelRatio(pixelRatio);
-#endif
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
p.setRenderHint(QPainter::Antialiasing, true);