Make sure we copy *all known events* properly in order to not assert.

This caused the following assertion in tst_QAccessibility::listTest():
ASSERT: "m_type != QAccessible::TableModelChanged" in file
qaccessible.h, line 455

Change-Id: If1f1e80521f346019bdbd59aac58e30c870d6e4e
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
Jan Arve Saether 2012-10-18 11:21:20 +02:00 committed by The Qt Project
parent bfbeaffda8
commit 8660a3bce1

View File

@ -218,6 +218,14 @@ private:
ev = upd; ev = upd;
} else if (event->type() == QAccessible::ValueChanged) { } else if (event->type() == QAccessible::ValueChanged) {
ev = new QAccessibleValueChangeEvent(event->object(), static_cast<QAccessibleValueChangeEvent*>(event)->value()); ev = new QAccessibleValueChangeEvent(event->object(), static_cast<QAccessibleValueChangeEvent*>(event)->value());
} else if (event->type() == QAccessible::TableModelChanged) {
QAccessibleTableModelChangeEvent *oldEvent = static_cast<QAccessibleTableModelChangeEvent*>(event);
QAccessibleTableModelChangeEvent *newEvent = new QAccessibleTableModelChangeEvent(event->object(), oldEvent->modelChangeType());
newEvent->setFirstRow(oldEvent->firstRow());
newEvent->setFirstColumn(oldEvent->firstColumn());
newEvent->setLastRow(oldEvent->lastRow());
newEvent->setLastColumn(oldEvent->lastColumn());
ev = newEvent;
} else { } else {
ev = new QAccessibleEvent(event->object(), event->type()); ev = new QAccessibleEvent(event->object(), event->type());
} }