sliderReleased() is emitted when the user releases the slider.sliderMoved() is emitted when the user drags the slider.sliderPressed() is emitted when the user starts to drag the slider.rangeChanged() is emitted when the scroll bar's range of values has changed.The tracking() determines whether this signal is emitted during user interaction. valueChanged() is emitted when the scroll bar's value has changed.ScrollBar inherits a comprehensive set of signals from QAbstractSlider: Beyond that, it becomes difficult for the user to control the slider using either the keyboard or the mouse, and the scroll arrows will have limited use. Note that although QScrollBar handles very large numbers, scroll bars on current screens cannot usefully represent ranges above about 100,000 pixels. In such cases, the following equation is useful: document length = maximum() - minimum() + pageStep(). The scroll bar's range of values is determined by subtracting a chosen page step from some value representing the length of the document. The relationship between a document length, the range of values used in a scroll bar, and the page step is simple in many common situations. This would give us a scroll bar with five "pages". If we have a document with 100 lines, and we can only show 20 lines in a widget, we may wish to construct a scroll bar with a page step of 20, a minimum value of 0, and a maximum value of 80. The range of values specified for the scroll bar are often determined differently to those for a QSlider because the length of the slider needs to be taken into account. You do not need to take this into account when you choose values for the range and the page step. Note that the range of values used is independent of the actual size of the scroll bar widget. Smaller changes to the value defined by the line step are made using the cursor keys, and this quantity is set with setSingleStep(). The page step is the amount that the value changes by when the user presses the Page Up and Page Down keys, and is set with setPageStep(). The length of the slider is usually related to the value of the page step, and typically represents the proportion of the document area shown in a scrolling view. At the maximum value, the bottom (or right) edge of the slider will be at the bottom (or right) end of the scroll bar. At the minimum value, the top edge of the slider (for a vertical scroll bar) or left edge (for a horizontal scroll bar) will be at the top (or left) end of the scroll bar. The range of acceptable values can be set with setMinimum() and setMaximum(). This value always lies within the range of values defined for the scroll bar, from minimum() to maximum() inclusive. This value is usually the same as the length of the slider.Įach scroll bar has a value that indicates how far the slider is from the start of the scroll bar this is obtained with value() and set with setValue(). Clicking here moves the scroll bar towards the click by one "page". The page control is the area over which the slider is dragged (the scroll bar's background). In editors and list boxes a "line" might mean one line of text in an image viewer it might mean 20 pixels. For a vertical scroll bar connected to a text editor, these typically move the current position one "line" up or down, and adjust the position of the slider by a small amount. The scroll arrows are push buttons which can be used to accurately navigate to a particular place in a document. The slider provides a way to quickly go to any part of the document, but does not support accurate navigation within large documents. Scroll bars typically include four separate controls: a slider, scroll arrows, and a page control.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |