Class: QgsScrollBarHighlightController

class qgis.gui.QgsScrollBarHighlightController

Bases: sip.wrapper

Adds highlights (colored markers) to a scrollbar.

Added in version 3.38:

Methods

addHighlight

Adds a highlight to the scrollbar.

lineHeight

Returns the line height for text associated with the scroll area.

margin

Returns the document margins for the associated viewport.

removeAllHighlights

Removes all highlights from the scroll bar.

removeHighlights

Removes all highlights with matching category from the scrollbar.

scrollArea

Returns the associated scroll area.

scrollBar

Returns the associated scroll bar.

setLineHeight

Sets the line height for text associated with the scroll area.

setMargin

Sets the document margin for the associated viewport.

setScrollArea

Sets the associated scroll bar.

setVisibleRange

Sets the visible range of the scroll area (i.e. the viewport's height).

visibleRange

Returns the visible range of the scroll area (i.e. the viewport's height).

addHighlight(self, highlight: QgsScrollBarHighlight)

Adds a highlight to the scrollbar.

Parameters:

highlight (QgsScrollBarHighlight)

lineHeight(self) float

Returns the line height for text associated with the scroll area.

See also

setLineHeight()

Return type:

float

margin(self) float

Returns the document margins for the associated viewport.

See also

setMargin()

Return type:

float

removeAllHighlights(self)

Removes all highlights from the scroll bar.

removeHighlights(self, category: int)

Removes all highlights with matching category from the scrollbar.

Parameters:

category (int)

scrollArea(self) QAbstractScrollArea | None

Returns the associated scroll area.

See also

setScrollArea()

Return type:

Optional[QAbstractScrollArea]

scrollBar(self) QScrollBar | None

Returns the associated scroll bar.

Return type:

Optional[QScrollBar]

setLineHeight(self, height: float)

Sets the line height for text associated with the scroll area.

See also

lineHeight()

Parameters:

height (float)

setMargin(self, margin: float)

Sets the document margin for the associated viewport.

See also

margin()

Parameters:

margin (float)

setScrollArea(self, scrollArea: QAbstractScrollArea | None)

Sets the associated scroll bar.

See also

scrollArea()

Parameters:

scrollArea (Optional[QAbstractScrollArea])

setVisibleRange(self, visibleRange: float)

Sets the visible range of the scroll area (i.e. the viewport’s height).

See also

visibleRange()

Parameters:

visibleRange (float)

visibleRange(self) float

Returns the visible range of the scroll area (i.e. the viewport’s height).

Return type:

float