Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QWidgetRepaintManager Class Reference

#include <qwidgetrepaintmanager_p.h>

+ Collaboration diagram for QWidgetRepaintManager:

Public Types

enum  UpdateTime { UpdateNow , UpdateLater }
 
enum  BufferState { BufferValid , BufferInvalid }
 

Public Member Functions

 QWidgetRepaintManager (QWidget *t)
 
 ~QWidgetRepaintManager ()
 
QBackingStorebackingStore () const
 
void setBackingStore (QBackingStore *backingStore)
 
template<class T >
void markDirty (const T &r, QWidget *widget, UpdateTime updateTime=UpdateLater, BufferState bufferState=BufferValid)
 
void removeDirtyWidget (QWidget *w)
 
void sync (QWidget *exposedWidget, const QRegion &exposedRegion)
 Synchronizes the exposedRegion of the exposedWidget with the backing store.
 
void sync ()
 Synchronizes the backing store, i.e.
 
void markNeedsFlush (QWidget *widget, const QRegion &region, const QPoint &topLevelOffset)
 Marks the region of the widget as needing a flush.
 
void addStaticWidget (QWidget *widget)
 
void moveStaticWidgets (QWidget *reparented)
 
void removeStaticWidget (QWidget *widget)
 
QRegion staticContents (QWidget *widget=nullptr, const QRect &withinClipRect=QRect()) const
 Returns the static content inside the parent if non-zero; otherwise the static content for the entire backing store is returned.
 
QRegion dirtyRegion () const
 
QList< QWidget * > dirtyWidgetList () const
 
bool isDirty () const
 
bool bltRect (const QRect &rect, int dx, int dy, QWidget *widget)
 
QRhirhi () const
 

Detailed Description

Definition at line 32 of file qwidgetrepaintmanager_p.h.

Member Enumeration Documentation

◆ BufferState

Enumerator
BufferValid 
BufferInvalid 

Definition at line 42 of file qwidgetrepaintmanager_p.h.

◆ UpdateTime

Enumerator
UpdateNow 
UpdateLater 

Definition at line 36 of file qwidgetrepaintmanager_p.h.

Constructor & Destructor Documentation

◆ QWidgetRepaintManager()

QWidgetRepaintManager::QWidgetRepaintManager ( QWidget * t)

Definition at line 73 of file qwidgetrepaintmanager.cpp.

References Q_ASSERT.

◆ ~QWidgetRepaintManager()

QWidgetRepaintManager::~QWidgetRepaintManager ( )

Definition at line 100 of file qwidgetrepaintmanager.cpp.

References QList< T >::at(), and QList< T >::size().

+ Here is the call graph for this function:

Member Function Documentation

◆ addStaticWidget()

void QWidgetRepaintManager::addStaticWidget ( QWidget * widget)

Definition at line 1108 of file qwidgetrepaintmanager.cpp.

References QList< T >::append(), QListSpecialMethodsBase< T >::contains(), Q_ASSERT, QWidget::testAttribute(), Qt::WA_StaticContents, and widget.

+ Here is the call graph for this function:

◆ backingStore()

QBackingStore * QWidgetRepaintManager::backingStore ( ) const
inline

Definition at line 51 of file qwidgetrepaintmanager_p.h.

Referenced by QWidget::backingStore().

+ Here is the caller graph for this function:

◆ bltRect()

bool QWidgetRepaintManager::bltRect ( const QRect & rect,
int dx,
int dy,
QWidget * widget )

Definition at line 526 of file qwidgetrepaintmanager.cpp.

References QRegion::intersects(), QWidget::mapTo(), pos, rect, QBackingStore::scroll(), and widget.

Referenced by QWidgetPrivate::moveRect(), and QWidgetPrivate::scrollRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dirtyRegion()

QRegion QWidgetRepaintManager::dirtyRegion ( ) const
inline

Definition at line 69 of file qwidgetrepaintmanager_p.h.

◆ dirtyWidgetList()

QList< QWidget * > QWidgetRepaintManager::dirtyWidgetList ( ) const
inline

Definition at line 70 of file qwidgetrepaintmanager_p.h.

◆ isDirty()

bool QWidgetRepaintManager::isDirty ( ) const

Definition at line 1214 of file qwidgetrepaintmanager.cpp.

References QRegion::isEmpty(), and QList< T >::isEmpty().

Referenced by sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ markDirty()

template<class T >
template void QWidgetRepaintManager::markDirty< QRegion > ( const T & r,
QWidget * widget,
UpdateTime updateTime = UpdateLater,
BufferState bufferState = BufferValid )

Marks the region of the widget as dirty (if not already marked as dirty) and posts an UpdateRequest event to the top-level widget (if not already posted).

If updateTime is UpdateNow, the event is sent immediately instead of posted.

If bufferState is BufferInvalid, all widgets intersecting with the region will be dirty.

If the widget paints directly on screen, the event is sent to the widget instead of the top-level widget, and bufferState is completely ignored.

Definition at line 168 of file qwidgetrepaintmanager.cpp.

References BufferInvalid, QWidgetPrivate::get(), QRegion::isEmpty(), QList< T >::isEmpty(), QWidget::isVisible(), QWidget::mapTo(), Q_ASSERT, qCInfo, QWidget::size, QRegion::translated(), QRect::translated(), UpdateNow, QWidget::updatesEnabled, widget, widgetRectFor(), and QWidget::window().

Referenced by QWidgetPrivate::moveRect(), and QWidgetPrivate::scrollRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ markNeedsFlush()

void QWidgetRepaintManager::markNeedsFlush ( QWidget * widget,
const QRegion & region,
const QPoint & topLevelOffset )

Marks the region of the widget as needing a flush.

The region will be copied from the backing store to the widget's native parent next time flush() is called.

Paint on screen widgets are ignored.

Definition at line 921 of file qwidgetrepaintmanager.cpp.

References hasPlatformWindow(), QRegion::isEmpty(), QWidget::isWindow(), QWidget::mapTo(), markNeedsFlush(), QWidget::nativeParentWidget(), qCInfo, QRegion::translated(), and widget.

Referenced by QWidgetPrivate::drawWidget(), markNeedsFlush(), QWidgetPrivate::moveRect(), QWidgetPrivate::scrollRect(), and sync().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveStaticWidgets()

void QWidgetRepaintManager::moveStaticWidgets ( QWidget * reparented)

Definition at line 1120 of file qwidgetrepaintmanager.cpp.

References QList< T >::at(), i, Q_ASSERT, QList< T >::removeAt(), and QList< T >::size().

+ Here is the call graph for this function:

◆ removeDirtyWidget()

void QWidgetRepaintManager::removeDirtyWidget ( QWidget * w)

Definition at line 292 of file qwidgetrepaintmanager.cpp.

References QList< T >::at(), child, QObjectData::children, i, QList< T >::removeAll(), removeDirtyWidget(), and QList< T >::size().

Referenced by removeDirtyWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeStaticWidget()

void QWidgetRepaintManager::removeStaticWidget ( QWidget * widget)

Definition at line 1140 of file qwidgetrepaintmanager.cpp.

References QList< T >::removeAll(), and widget.

+ Here is the call graph for this function:

◆ rhi()

QRhi * QWidgetRepaintManager::rhi ( ) const

Definition at line 1311 of file qwidgetrepaintmanager.cpp.

References QBackingStore::handle(), and QPlatformBackingStore::rhi().

+ Here is the call graph for this function:

◆ setBackingStore()

void QWidgetRepaintManager::setBackingStore ( QBackingStore * backingStore)
inline

Definition at line 52 of file qwidgetrepaintmanager_p.h.

◆ staticContents()

QRegion QWidgetRepaintManager::staticContents ( QWidget * parent = nullptr,
const QRect & withinClipRect = QRect() ) const

Returns the static content inside the parent if non-zero; otherwise the static content for the entire backing store is returned.

The content will be clipped to withinClipRect if non-empty.

Definition at line 1155 of file qwidgetrepaintmanager.cpp.

References QList< T >::at(), QObject::children(), QWidgetPrivate::clipRect(), QWidgetPrivate::clipToEffectiveMask(), QWidgetPrivate::extra, i, QWidget::isAncestorOf(), QRegion::isEmpty(), QList< T >::isEmpty(), QWidgetPrivate::isOpaque, rect, QBackingStore::size(), QList< T >::size(), QWidgetPrivate::subtractOpaqueSiblings(), QWidget::testAttribute(), QRegion::translate(), and Qt::WA_StaticContents.

Referenced by QWidgetPrivate::invalidateBackingStore_resizeHelper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sync() [1/2]

void QWidgetRepaintManager::sync ( )

Synchronizes the backing store, i.e.

dirty areas are repainted and flushed.

Definition at line 638 of file qwidgetrepaintmanager.cpp.

References QList< T >::at(), QList< T >::clear(), i, QWidget::isVisible(), qCInfo, qt_widget_private(), and QList< T >::size().

+ Here is the call graph for this function:

◆ sync() [2/2]

void QWidgetRepaintManager::sync ( QWidget * exposedWidget,
const QRegion & exposedRegion )

Synchronizes the exposedRegion of the exposedWidget with the backing store.

If there are dirty widgets, including but not limited to the exposedWidget, these will be repainted first. The backingstore is then flushed to the screen, regardless of whether or not there were any repaints.

Definition at line 605 of file qwidgetrepaintmanager.cpp.

References hasPlatformWindow(), isDirty(), QRegion::isEmpty(), QSize::isValid(), QWidget::isVisible(), QWidget::mapTo(), markNeedsFlush(), qCInfo, QBackingStore::size(), Qt::WA_Mapped, and widgetTexturesFor().

+ Here is the call graph for this function:

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