Class: QgsScrollArea

class qgis.gui.QgsScrollArea(parent: QWidget = None)

Bases: PyQt5.QtWidgets.QScrollArea

Constructor for QgsScrollArea.

A QScrollArea subclass with improved scrolling behavior.

QgsScrollArea should be used instead of QScrollArea widgets. In most cases the use is identical, however QgsScrollArea has extra logic to avoid wheel events changing child widget values when the mouse cursor is temporarily located over a child widget during a scroll event.

All QGIS code and plugins should use QgsScrollArea in place of QScrollArea.

New in version 3.0.

Parameters

parent

actionEvent()
changeEvent()
childEvent()
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
drawFrame()
dropEvent()
enterEvent()
event()
eventFilter()
focusInEvent()
focusNextChild()
focusOutEvent()
focusPreviousChild()
hasScrolled(self) → bool

Returns True if a scroll recently occurred within the QScrollArea or its child viewport()

Return type

bool

hideEvent()
initPainter()
initStyleOption()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
resizeEvent(self, event: QResizeEvent)
Parameters

event (QResizeEvent) –

scrollContentsBy()
scrollOccurred(self)

Should be called when a scroll occurs on with the QScrollArea itself or its child viewport().

sender()
senderSignalIndex()
setVerticalOnly(self, verticalOnly: bool)

Sets whether the scroll area only applies vertical.

If set to True, then scroll area children will resize horizontally to match the width of the scroll area widget.

New in version 3.8.

Parameters

verticalOnly (bool) –

setViewportMargins()
sharedPainter()
showEvent()
tabletEvent()
timerEvent()
updateMicroFocus()
viewportEvent()
viewportMargins()
viewportSizeHint()
wheelEvent(self, event: QWheelEvent)
Parameters

event (QWheelEvent) –