diff options
author | Gerald Combs <gerald@wireshark.org> | 2016-05-01 15:40:34 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2016-05-02 15:19:44 +0000 |
commit | b274bddbc0e46533f222a71c4075c8681bbd41c3 (patch) | |
tree | d9e1e29544ddb607ce7bd4c1e54e1cacccf67321 /ui/qt/overlay_scroll_bar.h | |
parent | 2e23b506c766d98966ed213c760b2aa6232ba1fe (diff) | |
download | wireshark-b274bddbc0e46533f222a71c4075c8681bbd41c3.tar.gz |
Qt: Make the overlay scroll bar work with Qt 4.
In Qt 4, QScrollBar::setRange isn't a slot. Add a setChildRange
slot and connect to it instead. Add a QT_VERSION_CHECK breadcrumb in
a comment.
Change-Id: Ie28bbb6bd8249c31154a2fe236667adf1d53df61
Reviewed-on: https://code.wireshark.org/review/15215
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/overlay_scroll_bar.h')
-rw-r--r-- | ui/qt/overlay_scroll_bar.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/qt/overlay_scroll_bar.h b/ui/qt/overlay_scroll_bar.h index a9e2d7ad3b..699ff11ef9 100644 --- a/ui/qt/overlay_scroll_bar.h +++ b/ui/qt/overlay_scroll_bar.h @@ -59,6 +59,10 @@ public: QRect grooveRect(); public slots: + // Qt 4's QScrollBar::setRange isn't a slot. We can't wrap this in + //#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) + // because Qt 4's MOC doesn't support macros. + void setChildRange(int min, int max) { child_sb_.setRange(min, max); } protected: virtual void resizeEvent(QResizeEvent * event); @@ -76,6 +80,7 @@ private: int start_pos_; int end_pos_; int selected_pos_; + }; #endif // __OVERLAY_SCROLL_BAR_H__ |