From 11d8738af42d2c14e52a441f5ed401bdde1e5310 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 9 Nov 2010 22:16:05 +0000 Subject: [PATCH] minimum and maximum settable from javascript svn path=/trunk/KDE/kdelibs/; revision=1194798 --- widgets/scrollbar.cpp | 10 ++++++++++ widgets/scrollbar.h | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/widgets/scrollbar.cpp b/widgets/scrollbar.cpp index ed16bd1f2..c8f996713 100644 --- a/widgets/scrollbar.cpp +++ b/widgets/scrollbar.cpp @@ -102,6 +102,16 @@ int ScrollBar::maximum() const return static_cast(widget())->maximum(); } +void ScrollBar::setMinimum(const int min) const +{ + static_cast(widget())->setMinimum(min); +} + +void ScrollBar::setMaximum(const int max) const +{ + static_cast(widget())->setMaximum(max); +} + void ScrollBar::setStyleSheet(const QString &stylesheet) { widget()->setStyleSheet(stylesheet); diff --git a/widgets/scrollbar.h b/widgets/scrollbar.h index 44f6a2e50..85e4e69df 100644 --- a/widgets/scrollbar.h +++ b/widgets/scrollbar.h @@ -43,8 +43,8 @@ class PLASMA_EXPORT ScrollBar : public QGraphicsProxyWidget Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep) Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep) Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) - Q_PROPERTY(int minimum READ minimum) - Q_PROPERTY(int maximum READ maximum) + Q_PROPERTY(int minimum READ minimum WRITE setMinimum) + Q_PROPERTY(int maximum READ maximum WRITE setMaximum) Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet) Q_PROPERTY(QScrollBar *nativeWidget READ nativeWidget) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) @@ -102,6 +102,18 @@ public: */ int maximum() const; + /** + * @arg the minimum value bound of this ScrollBar + * @since 4.6 + */ + void setMinimum(const int min) const; + + /** + * @arg the maximum value bound of this ScrollBar + * @since 4.6 + */ + void setMaximum(const int max) const; + /** * Sets the stylesheet used to control the visual display of this ScrollBar *