/*! Sets the current \a value for the scrollbar with orientation \a orientation. The scrollbar forces the \a value to be within the legal range: minimum <= value <= maximum. Changing the value also updates the thumb position. \sa scrollBarMinimum(), scrollBarMaximum() */ void QWebFrame::setScrollBarValue(Qt::Orientation orientation, int value) { Scrollbar *sb; sb = (orientation == Qt::Horizontal) ? d->horizontalScrollBar() : d->verticalScrollBar(); if (sb) { if (value < 0) value = 0; else if (value > scrollBarMaximum(orientation)) value = scrollBarMaximum(orientation); sb->setValue(value); } }
Control* createScrollbar(const Loader& e, int o) { int min = e.attribute("min", 0); int max = e.attribute("max", 10); int value = e.attribute("value", min); int width = e.attribute("width", 0); int height= e.attribute("height", 0); int event = e.attribute("event", 0); if(width==0 && o==Scrollbar::VERTICAL) width=16; else if(height==0 && o==Scrollbar::HORIZONTAL) height=16; Scrollbar* c = new Scrollbar(o, width, height, min, max, e.style(), event); c->setValue(value); return c; }