add scrollbar for kinetic list
[kineticlist.git] / scrollbar.cpp
blob2b85f98a2d7e7f92aefed9253f18ae254fa30764
1 #include "scrollbar.h"
3 #include <QScrollBar>
5 #include <QDebug>
6 ScrollBar::ScrollBar( QGraphicsItem *parent )
7 : QGraphicsProxyWidget( parent )
9 QScrollBar *scrollbar = new QScrollBar;
11 setWidget( scrollbar );
14 ScrollBar::~ScrollBar()
18 void ScrollBar::setMaximum( int max )
20 QScrollBar *scrollbar = static_cast<QScrollBar *>( widget() );
21 scrollbar->setMaximum( max );
24 void ScrollBar::setValue( int value )
26 QScrollBar *scrollbar = static_cast<QScrollBar *>( widget() );
27 qDebug()<<scrollbar->sliderPosition( );
28 scrollbar->setValue( -value );