aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/widgets/overlay_scroll_bar.cpp
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2018-04-05 15:12:39 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2018-04-05 18:48:57 +0000
commit3a928f1f879cfc63580181a316229733f8b81b0e (patch)
treeed3cb6334edf78751cceadd4702234b1727fec94 /ui/qt/widgets/overlay_scroll_bar.cpp
parentc4da7ed843527ac75bc46d74e43de1b61fa5c5f5 (diff)
Qt: Remove checks for version below 5.2
This stops the main source from being buildable by Qt 4.x Change-Id: I61edbae04ac2b3bf0ae8ee8e09d335083945c176 Reviewed-on: https://code.wireshark.org/review/26756 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/qt/widgets/overlay_scroll_bar.cpp')
-rw-r--r--ui/qt/widgets/overlay_scroll_bar.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/ui/qt/widgets/overlay_scroll_bar.cpp b/ui/qt/widgets/overlay_scroll_bar.cpp
index 95b9e2de69..0b66a88ec1 100644
--- a/ui/qt/widgets/overlay_scroll_bar.cpp
+++ b/ui/qt/widgets/overlay_scroll_bar.cpp
@@ -105,9 +105,7 @@ void OverlayScrollBar::setNearOverlayImage(QImage &overlay_image, int packet_cou
if (old_width != packet_map_img_.width()) {
qreal dp_ratio = 1.0;
- #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
dp_ratio = devicePixelRatio();
- #endif
packet_map_width_ = packet_map_img_.width() / dp_ratio;
@@ -119,9 +117,7 @@ void OverlayScrollBar::setNearOverlayImage(QImage &overlay_image, int packet_cou
void OverlayScrollBar::setMarkedPacketImage(QImage &mp_image)
{
qreal dp_ratio = 1.0;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
dp_ratio = devicePixelRatio();
-#endif
marked_packet_img_ = mp_image;
marked_packet_width_ = mp_image.width() / dp_ratio;
@@ -151,10 +147,8 @@ void OverlayScrollBar::paintEvent(QPaintEvent *event)
{
qreal dp_ratio = 1.0;
QSize pm_size(packet_map_width_, geometry().height());
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
dp_ratio = devicePixelRatio();
pm_size *= dp_ratio;
-#endif
QPainter painter(this);
@@ -190,9 +184,7 @@ void OverlayScrollBar::paintEvent(QPaintEvent *event)
pm_painter.restore();
// Draw the map.
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
packet_map.setDevicePixelRatio(dp_ratio);
-#endif
painter.drawImage(0, 0, packet_map);
}
}
@@ -207,12 +199,10 @@ bool OverlayScrollBar::eventFilter(QObject *watched, QEvent *event)
if (!marked_packet_img_.isNull()) {
QRect groove_rect = grooveRect();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
qreal dp_ratio = 1.0;
dp_ratio = devicePixelRatio();
groove_rect.setTopLeft(groove_rect.topLeft() * dp_ratio);
groove_rect.setSize(groove_rect.size() * dp_ratio);
-#endif
QImage marked_map(groove_rect.width(), groove_rect.height(), QImage::Format_ARGB32_Premultiplied);
marked_map.fill(Qt::transparent);
@@ -223,9 +213,7 @@ bool OverlayScrollBar::eventFilter(QObject *watched, QEvent *event)
QRect far_dest(0, 0, groove_rect.width(), groove_rect.height());
mm_painter.drawImage(far_dest, marked_packet_img_.scaled(far_dest.size(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
- #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
marked_map.setDevicePixelRatio(dp_ratio);
- #endif
QPainter painter(&child_sb_);
painter.drawImage(groove_rect.left(), groove_rect.top(), marked_map);
}