QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
QgsScrollArea Class Reference

A QScrollArea subclass with improved scrolling behavior. More...

#include <qgsscrollarea.h>

Inheritance diagram for QgsScrollArea:
Inheritance graph
[legend]

Public Member Functions

 QgsScrollArea (QWidget *parent=nullptr)
 Constructor for QgsScrollArea.
 
bool hasScrolled () const
 Returns true if a scroll recently occurred within the QScrollArea or its child viewport()
 
void resetHasScrolled ()
 Resets the hasScrolled() flag.
 
void scrollOccurred ()
 Should be called when a scroll occurs on with the QScrollArea itself or its child viewport().
 
void setVerticalOnly (bool verticalOnly)
 Sets whether the scroll area only applies vertical.
 

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 

Detailed Description

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.

Definition at line 40 of file qgsscrollarea.h.

Constructor & Destructor Documentation

◆ QgsScrollArea()

QgsScrollArea::QgsScrollArea ( QWidget *  parent = nullptr)
explicit

Constructor for QgsScrollArea.

Definition at line 26 of file qgsscrollarea.cpp.

Member Function Documentation

◆ hasScrolled()

bool QgsScrollArea::hasScrolled ( ) const

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

Definition at line 54 of file qgsscrollarea.cpp.

◆ resetHasScrolled()

void QgsScrollArea::resetHasScrolled ( )

Resets the hasScrolled() flag.

Since
QGIS 3.24

Definition at line 59 of file qgsscrollarea.cpp.

◆ resizeEvent()

void QgsScrollArea::resizeEvent ( QResizeEvent *  event)
overrideprotected

Definition at line 41 of file qgsscrollarea.cpp.

◆ scrollOccurred()

void QgsScrollArea::scrollOccurred ( )

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

Definition at line 48 of file qgsscrollarea.cpp.

◆ setVerticalOnly()

void QgsScrollArea::setVerticalOnly ( bool  verticalOnly)

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.

Since
QGIS 3.8

Definition at line 64 of file qgsscrollarea.cpp.

◆ wheelEvent()

void QgsScrollArea::wheelEvent ( QWheelEvent *  event)
overrideprotected

Definition at line 34 of file qgsscrollarea.cpp.


The documentation for this class was generated from the following files: