Fix backingstore crash with QAxWidgets

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 <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Miikka Heikkinen 2012-05-18 10:55:26 +03:00 committed by Qt by Nokia
parent dd699d5ea5
commit 5a110517bb
2 changed files with 4 additions and 5 deletions

View File

@ -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 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. 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()) { if (!dirtyOnScreen.isEmpty()) {
QWidget *target = widget ? widget : tlw; QWidget *target = widget ? widget : tlw;
QBackingStore *source = store ? store : backingStore; qt_flush(target, dirtyOnScreen, store, tlw, tlwOffset);
qt_flush(target, dirtyOnScreen, source, tlw, tlwOffset);
dirtyOnScreen = QRegion(); dirtyOnScreen = QRegion();
} }
@ -1102,7 +1101,7 @@ void QWidgetBackingStore::flush(QWidget *widget, QBackingStore *backingStore)
QWidget *w = dirtyOnScreenWidgets->at(i); QWidget *w = dirtyOnScreenWidgets->at(i);
QWidgetPrivate *wd = w->d_func(); QWidgetPrivate *wd = w->d_func();
Q_ASSERT(wd->needsFlush); Q_ASSERT(wd->needsFlush);
qt_flush(w, *wd->needsFlush, backingStore, tlw, tlwOffset); qt_flush(w, *wd->needsFlush, store, tlw, tlwOffset);
*wd->needsFlush = QRegion(); *wd->needsFlush = QRegion();
} }
dirtyOnScreenWidgets->clear(); dirtyOnScreenWidgets->clear();

View File

@ -77,7 +77,7 @@ public:
void sync(QWidget *exposedWidget, const QRegion &exposedRegion); void sync(QWidget *exposedWidget, const QRegion &exposedRegion);
void sync(); void sync();
void flush(QWidget *widget = 0, QBackingStore *store = 0); void flush(QWidget *widget = 0);
inline QPoint topLevelOffset() const { return tlwOffset; } inline QPoint topLevelOffset() const { return tlwOffset; }