예제 #1
0
/*!
  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);
    }
}
예제 #2
0
파일: guifile.cpp 프로젝트: sgynn/base
		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;
		}