[Qt-interest] Horizontal scroll bar max value.

phil prentice philp.cheer at talktalk.net
Mon Apr 27 12:50:53 CEST 2009


Just to make things clear.  Changing verticalScrollBar() to
horizontalScrollBar() does not fix my problem  it was just a typo in my 
example.

Is what I am trying to do not possible using QScrollBar?
Sorry about the confusion

Phil

On Monday 27 April 2009 10:19, phil prentice wrote:
> Sorry
>   I knocked this example up this morning and made a stupid mistake
> list->verticalScrollBar()->setMaximum(500);
> should read list->horizontalScrollBar()->setMaximum(500);
>
> Similar setPageStep(50);
>
> To much beer last night!!
>
> Phil
>
> On Monday 27 April 2009 10:10, phil prentice wrote:
> > Hi Everyone
> >
> >   I am having problems trying to make a scroll bar work the way I want it
> > to in a QListView(). I need to be able to scroll the existing data right
> > out of the view i.e.
> >
> >                                Display Area
> >                              _____________
> >
> >
> > <-------Items---------->|<....empty.....>|
> >
> >
> >                              -----------------------
> >
> > I've tried various things, but failed. For example if I create a long
> > file name say XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
> >
> > and I run the following program I cant seem to change the maximum value
> > or get the results that I need?
> >
> > #include <QtGui>
> > int main(int argc, char *argv[])
> > {
> >   QApplication app(argc, argv);
> >   QSplitter *splitter = new QSplitter;
> >   QDirModel *model = new QDirModel;
> >   QListView *list = new QListView(splitter);
> >   list->setModel(model);
> >   list->setRootIndex(model->index(QDir::currentPath()));
> >   splitter->setWindowTitle("PLEASE HELP!!!");
> >   list->verticalScrollBar()->setMaximum(500); /* Tryed various things. */
> >   list->verticalScrollBar()->setPageStep(50);
> >   splitter->show();
> >   return app.exec();
> > }
> >
> > I can play around with setMaximum() & setPageStep() to no avail???
> > I've tryed sub-classing QScrollBar but again no luck.  How can I achieve
> > my requirement.
> >
> > Thanks
> > Any comments very welcome
> >
> > Phil
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list