widgets: Rename QWidgetPrivate::repaint_sys to paintOnScreen

Change-Id: Ic853e42cbed9b770bef0e1d7c7376c861bceb891
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-08-23 15:19:52 +02:00
parent 6dd5cb40ef
commit e8c70fb07f
5 changed files with 13 additions and 13 deletions

View File

@ -184,7 +184,7 @@ public:
inline void dispatchPendingUpdateRequests() inline void dispatchPendingUpdateRequests()
{ {
if (qt_widget_private(viewport)->paintOnScreen()) if (qt_widget_private(viewport)->shouldPaintOnScreen())
QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest); QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest);
else else
QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest); QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest);

View File

@ -1758,8 +1758,8 @@ QRegion QWidgetPrivate::overlappedRegion(const QRect &rect, bool breakAfterFirst
void QWidgetPrivate::syncBackingStore() void QWidgetPrivate::syncBackingStore()
{ {
if (paintOnScreen()) { if (shouldPaintOnScreen()) {
repaint_sys(dirty); paintOnScreen(dirty);
dirty = QRegion(); dirty = QRegion();
} else if (QWidgetRepaintManager *repaintManager = maybeRepaintManager()) { } else if (QWidgetRepaintManager *repaintManager = maybeRepaintManager()) {
repaintManager->sync(); repaintManager->sync();
@ -1768,14 +1768,14 @@ void QWidgetPrivate::syncBackingStore()
void QWidgetPrivate::syncBackingStore(const QRegion &region) void QWidgetPrivate::syncBackingStore(const QRegion &region)
{ {
if (paintOnScreen()) if (shouldPaintOnScreen())
repaint_sys(region); paintOnScreen(region);
else if (QWidgetRepaintManager *repaintManager = maybeRepaintManager()) { else if (QWidgetRepaintManager *repaintManager = maybeRepaintManager()) {
repaintManager->sync(q_func(), region); repaintManager->sync(q_func(), region);
} }
} }
void QWidgetPrivate::repaint_sys(const QRegion &rgn) void QWidgetPrivate::paintOnScreen(const QRegion &rgn)
{ {
if (data.in_destructor) if (data.in_destructor)
return; return;
@ -2138,7 +2138,7 @@ void QWidgetPrivate::clipToEffectiveMask(QRegion &region) const
} }
} }
bool QWidgetPrivate::paintOnScreen() const bool QWidgetPrivate::shouldPaintOnScreen() const
{ {
#if defined(QT_NO_BACKINGSTORE) #if defined(QT_NO_BACKINGSTORE)
return true; return true;
@ -5276,7 +5276,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
return; return;
const bool asRoot = flags & DrawAsRoot; const bool asRoot = flags & DrawAsRoot;
bool onScreen = paintOnScreen(); bool onScreen = shouldPaintOnScreen();
Q_Q(QWidget); Q_Q(QWidget);
#if QT_CONFIG(graphicseffect) #if QT_CONFIG(graphicseffect)

View File

@ -350,7 +350,8 @@ public:
#if QT_CONFIG(graphicsview) #if QT_CONFIG(graphicsview)
static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin); static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin);
#endif #endif
void repaint_sys(const QRegion &rgn); bool shouldPaintOnScreen() const;
void paintOnScreen(const QRegion &rgn);
QRect clipRect() const; QRect clipRect() const;
QRegion clipRegion() const; QRegion clipRegion() const;
@ -362,7 +363,6 @@ public:
void updateIsOpaque(); void updateIsOpaque();
void setOpaque(bool opaque); void setOpaque(bool opaque);
void updateIsTranslucent(); void updateIsTranslucent();
bool paintOnScreen() const;
#if QT_CONFIG(graphicseffect) #if QT_CONFIG(graphicseffect)
void invalidateGraphicsEffectsRecursively(); void invalidateGraphicsEffectsRecursively();
#endif // QT_CONFIG(graphicseffect) #endif // QT_CONFIG(graphicseffect)

View File

@ -221,7 +221,7 @@ void QWidgetRepaintManager::markDirty(const T &r, QWidget *widget, UpdateTime up
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
if (widget->d_func()->paintOnScreen()) { if (widget->d_func()->shouldPaintOnScreen()) {
if (widget->d_func()->dirty.isEmpty()) { if (widget->d_func()->dirty.isEmpty()) {
widget->d_func()->dirty = r; widget->d_func()->dirty = r;
sendUpdateRequest(widget, updateTime); sendUpdateRequest(widget, updateTime);
@ -1019,7 +1019,7 @@ void QWidgetRepaintManager::paintAndFlush()
*/ */
void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset) void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset)
{ {
if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty()) if (!widget || widget->d_func()->shouldPaintOnScreen() || region.isEmpty())
return; return;
if (widget == tlw) { if (widget == tlw) {

View File

@ -803,7 +803,7 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
if (updateSize()) { if (updateSize()) {
QGuiApplication::forwardEvent(m_widget, event); QGuiApplication::forwardEvent(m_widget, event);
if (m_widget->d_func()->paintOnScreen()) { if (m_widget->d_func()->shouldPaintOnScreen()) {
QRegion updateRegion(geometry()); QRegion updateRegion(geometry());
if (m_widget->testAttribute(Qt::WA_StaticContents)) if (m_widget->testAttribute(Qt::WA_StaticContents))
updateRegion -= QRect(0, 0, oldSize.width(), oldSize.height()); updateRegion -= QRect(0, 0, oldSize.width(), oldSize.height());