fix overshoot condition values
[kineticlist.git] / scrollbar.cpp
blobc075d540d71260c1fbb0a167698c8e54d3410c41
1 #include "scrollbar.h"
3 #include <QScrollBar>
5 ScrollBar::ScrollBar( QGraphicsItem *parent )
6 : QGraphicsProxyWidget( parent )
8 QScrollBar *scrollbar = new QScrollBar;
10 connect( scrollbar, SIGNAL( valueChanged( int ) ), this, SLOT( setValueChanged( int ) ) );
12 setWidget( scrollbar );
15 ScrollBar::~ScrollBar()
19 void ScrollBar::setValueChanged( int value )
21 emit valueChanged( value );
24 void ScrollBar::setMaximum( int max )
26 QScrollBar *scrollbar = static_cast<QScrollBar *>( widget() );
27 scrollbar->setMaximum( max );
30 void ScrollBar::setValue( int value )
32 QScrollBar *scrollbar = static_cast<QScrollBar *>( widget() );
33 scrollbar->setValue( -value );