From 5a110517bb3e2df7aaf66e33ad37b2201ebd62f6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 18 May 2012 10:55:26 +0300 Subject: Fix backingstore crash with QAxWidgets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The crash was caused by the fact that backingStore parameter is always null (there seems to be no call in codebase that uses anything else but the default values for this function). Using "store" member variable instead of "backingStore" parameter gets rid of the crash, and it is how it was in Qt4 - probably the bug crept in when the paremeter and member variables were renamed in Qt5. Task-number: QTBUG-25803 Change-Id: I4b1ccf540fddd6baa1dffa7f8165272b54caf238 Reviewed-by: Friedemann Kleint Reviewed-by: Samuel Rødal --- src/widgets/kernel/qwidgetbackingstore.cpp | 7 +++---- src/widgets/kernel/qwidgetbackingstore_p.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index a697578bc7..eb86f25601 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -1086,12 +1086,11 @@ void QWidgetBackingStore::sync() If the \a widget is non-zero, the content is flushed to the \a widget. If the \a surface is non-zero, the content of the \a surface is flushed. */ -void QWidgetBackingStore::flush(QWidget *widget, QBackingStore *backingStore) +void QWidgetBackingStore::flush(QWidget *widget) { if (!dirtyOnScreen.isEmpty()) { QWidget *target = widget ? widget : tlw; - QBackingStore *source = store ? store : backingStore; - qt_flush(target, dirtyOnScreen, source, tlw, tlwOffset); + qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset); dirtyOnScreen = QRegion(); } @@ -1102,7 +1101,7 @@ void QWidgetBackingStore::flush(QWidget *widget, QBackingStore *backingStore) QWidget *w = dirtyOnScreenWidgets->at(i); QWidgetPrivate *wd = w->d_func(); Q_ASSERT(wd->needsFlush); - qt_flush(w, *wd->needsFlush, backingStore, tlw, tlwOffset); + qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset); *wd->needsFlush = QRegion(); } dirtyOnScreenWidgets->clear(); diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h index 7c350932ea..6f192d1f42 100644 --- a/src/widgets/kernel/qwidgetbackingstore_p.h +++ b/src/widgets/kernel/qwidgetbackingstore_p.h @@ -77,7 +77,7 @@ public: void sync(QWidget *exposedWidget, const QRegion &exposedRegion); void sync(); - void flush(QWidget *widget = 0, QBackingStore *store = 0); + void flush(QWidget *widget = 0); inline QPoint topLevelOffset() const { return tlwOffset; } -- cgit v1.2.3