Class: QgsScrollArea

class qgis.gui.QgsScrollArea

Bases: PyQt5.QtWidgets.QScrollArea

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.

QgsScrollArea(parent: QWidget = None) Constructor for QgsScrollArea.

Methods

actionEvent

changeEvent

childEvent

closeEvent

connectNotify

contextMenuEvent

create

customEvent

destroy

disconnectNotify

dragEnterEvent

dragLeaveEvent

dragMoveEvent

drawFrame

dropEvent

enterEvent

event

eventFilter

focusInEvent

focusNextChild

focusOutEvent

focusPreviousChild

hasScrolled

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

hideEvent

initPainter

initStyleOption

inputMethodEvent

isSignalConnected

keyPressEvent

keyReleaseEvent

leaveEvent

metric

mouseDoubleClickEvent

mouseMoveEvent

mousePressEvent

mouseReleaseEvent

moveEvent

nativeEvent

paintEvent

receivers

resizeEvent

param event

scrollContentsBy

scrollOccurred

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

sender

senderSignalIndex

setVerticalOnly

Sets whether the scroll area only applies vertical.

setViewportMargins

sharedPainter

showEvent

tabletEvent

timerEvent

updateMicroFocus

viewportEvent

viewportMargins

viewportSizeHint

wheelEvent

param event

actionEvent(self, QActionEvent)
changeEvent(self, QEvent)
childEvent(self, QChildEvent)
closeEvent(self, QCloseEvent)
connectNotify(self, QMetaMethod)
contextMenuEvent(self, QContextMenuEvent)
create(self, window: sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)
customEvent(self, QEvent)
destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)
disconnectNotify(self, QMetaMethod)
dragEnterEvent(self, QDragEnterEvent)
dragLeaveEvent(self, QDragLeaveEvent)
dragMoveEvent(self, QDragMoveEvent)
drawFrame(self, QPainter)
dropEvent(self, QDropEvent)
enterEvent(self, QEvent)
event(self, QEvent) bool
eventFilter(self, QObject, QEvent) bool
focusInEvent(self, QFocusEvent)
focusNextChild(self) bool
focusOutEvent(self, QFocusEvent)
focusPreviousChild(self) bool
hasScrolled(self) bool

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

Return type

bool

hideEvent(self, QHideEvent)
initPainter(self, QPainter)
initStyleOption(self, QStyleOptionFrame)
inputMethodEvent(self, QInputMethodEvent)
isSignalConnected(self, QMetaMethod) bool
keyPressEvent(self, QKeyEvent)
keyReleaseEvent(self, QKeyEvent)
leaveEvent(self, QEvent)
metric(self, QPaintDevice.PaintDeviceMetric) int
mouseDoubleClickEvent(self, QMouseEvent)
mouseMoveEvent(self, QMouseEvent)
mousePressEvent(self, QMouseEvent)
mouseReleaseEvent(self, QMouseEvent)
moveEvent(self, QMoveEvent)
nativeEvent(self, Union[QByteArray, bytes, bytearray], sip.voidptr) Tuple[bool, int]
paintEvent(self, QPaintEvent)
receivers(self, PYQT_SIGNAL) int
resizeEvent(self, event: QResizeEvent)
Parameters

event (QResizeEvent) –

QgsScrollArea.scrollContentsBy(self, int, int)
scrollOccurred(self)

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

sender(self) QObject
senderSignalIndex(self) int
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) –

QgsScrollArea.setViewportMargins(self, int, int, int, int)
setViewportMargins(self, QMargins) None
sharedPainter(self) QPainter
showEvent(self, QShowEvent)
tabletEvent(self, QTabletEvent)
timerEvent(self, QTimerEvent)
updateMicroFocus(self)
viewportEvent(self, QEvent) bool
viewportMargins(self) QMargins
viewportSizeHint(self) QSize
wheelEvent(self, event: QWheelEvent)
Parameters

event (QWheelEvent) –