summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/qt/overlay_scroll_bar.cpp2
-rw-r--r--ui/qt/overlay_scroll_bar.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/ui/qt/overlay_scroll_bar.cpp b/ui/qt/overlay_scroll_bar.cpp
index 766866c8a3..b7a589ccd4 100644
--- a/ui/qt/overlay_scroll_bar.cpp
+++ b/ui/qt/overlay_scroll_bar.cpp
@@ -73,7 +73,7 @@ OverlayScrollBar::OverlayScrollBar(Qt::Orientation orientation, QWidget *parent)
child_sb_.installEventFilter(this);
// XXX Do we need to connect anything else?
- connect(this, SIGNAL(rangeChanged(int,int)), &child_sb_, SLOT(setRange(int,int)));
+ connect(this, SIGNAL(rangeChanged(int,int)), this, SLOT(setChildRange(int,int)));
connect(this, SIGNAL(valueChanged(int)), &child_sb_, SLOT(setValue(int)));
connect(&child_sb_, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
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__