Make sure we copy *all known events* properly in order to not assert.
authorJan Arve Saether <jan-arve.saether@digia.com>
Thu, 18 Oct 2012 09:21:20 +0000 (11:21 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 18 Oct 2012 10:24:13 +0000 (12:24 +0200)
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>
src/testlib/qtestaccessible.h

index 88a554d..2642ee2 100644 (file)
@@ -218,6 +218,14 @@ private:
             ev = upd;
         } else if (event->type() == QAccessible::ValueChanged) {
             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 {
             ev = new QAccessibleEvent(event->object(), event->type());
         }