diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 4170df4799..f1a6a294d2 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -754,7 +754,7 @@ void QDialog::setVisible(bool visible) } #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogStart, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogStart, this)); #endif } else { @@ -763,7 +763,7 @@ void QDialog::setVisible(bool visible) #ifndef QT_NO_ACCESSIBILITY if (isVisible()) - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogEnd, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogEnd, this)); #endif // Reimplemented to exit a modal event loop when the dialog is hidden. diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 3909125fe7..e1b134ee48 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1463,7 +1463,7 @@ void QMessageBox::showEvent(QShowEvent *e) d->updateSize(); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Alert, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Alert, this)); #endif #ifdef Q_OS_WIN if (const HMENU systemMenu = qt_getWindowsSystemMenu(this)) { diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 015cd254d4..830853094a 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -843,7 +843,7 @@ void QGraphicsScenePrivate::setFocusItemHelper(QGraphicsItem *item, #ifndef QT_NO_ACCESSIBILITY if (focusItem) { if (QGraphicsObject *focusObj = focusItem->toGraphicsObject()) { - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, focusObj, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, focusObj)); } } #endif diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 4a6f3518d0..1c20b98139 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -412,7 +412,7 @@ QWhatsThisPrivate::QWhatsThisPrivate() #endif } #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpStart, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpStart, this)); #endif } @@ -424,7 +424,7 @@ QWhatsThisPrivate::~QWhatsThisPrivate() QApplication::restoreOverrideCursor(); #endif #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpEnd, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ContextHelpEnd, this)); #endif instance = 0; } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index bf864503a4..03ada1ac7a 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5965,7 +5965,7 @@ void QWidget::setFocus(Qt::FocusReason reason) // menus update the focus manually and this would create bogus events if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) # endif - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, f, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, f)); #endif #ifndef QT_NO_GRAPHICSVIEW if (QWExtra *topData = window()->d_func()->extra) { @@ -6045,7 +6045,7 @@ void QWidget::clearFocus() #endif { #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Focus, this)); #endif } } @@ -7052,7 +7052,7 @@ void QWidgetPrivate::show_helper() #ifndef QT_NO_ACCESSIBILITY if (q->windowType() != Qt::ToolTip) // Tooltips are read aloud twice in MS narrator. - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectShow, q, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectShow, q)); #endif if (QApplicationPrivate::hidden_focus_widget == q) { @@ -7143,7 +7143,7 @@ void QWidgetPrivate::hide_helper() #ifndef QT_NO_ACCESSIBILITY if (wasVisible) - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, q, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, q)); #endif } @@ -7375,7 +7375,7 @@ void QWidgetPrivate::hideChildren(bool spontaneous) qApp->d_func()->sendSyntheticEnterLeave(widget); #ifndef QT_NO_ACCESSIBILITY if (!spontaneous) - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, widget, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ObjectHide, widget)); #endif } } @@ -10386,7 +10386,7 @@ void QWidget::setAccessibleName(const QString &name) { Q_D(QWidget); d->accessibleName = name; - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this)); } QString QWidget::accessibleName() const @@ -10408,7 +10408,7 @@ void QWidget::setAccessibleDescription(const QString &description) { Q_D(QWidget); d->accessibleDescription = description; - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DescriptionChanged, this)); } QString QWidget::accessibleDescription() const diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 80e125947e..f7c8ad7773 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -647,7 +647,7 @@ void QAbstractButton::setText(const QString &text) update(); updateGeometry(); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this)); #endif } diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp index 6aff2e9077..b0216e5277 100644 --- a/src/widgets/widgets/qabstractslider.cpp +++ b/src/widgets/widgets/qabstractslider.cpp @@ -538,7 +538,7 @@ void QAbstractSlider::setValue(int value) emit sliderMoved((d->position = value)); } #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this)); #endif sliderChange(SliderValueChange); emit valueChanged(value); diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index e9652a9869..c083369136 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -976,7 +976,7 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event) } } #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this)); #endif return; } @@ -1595,7 +1595,7 @@ void QAbstractSpinBoxPrivate::updateState(bool up, bool fromKeyboard /* = false buttonState = (up ? Up : Down) | (fromKeyboard ? Keyboard : Mouse); q->stepBy(up ? 1 : -1); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, q, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, q)); #endif } } diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index e3404a62de..d06e98e31a 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -144,7 +144,7 @@ void QLineEditPrivate::_q_selectionChanged() emit q->selectionChanged(); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextSelectionChanged, q, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextSelectionChanged, q)); #endif } diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index fd030a5383..af4a87e282 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2091,7 +2091,7 @@ void QMenu::hideEvent(QHideEvent *) d->eventLoop->exit(); d->setCurrentAction(0); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::PopupMenuEnd, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::PopupMenuEnd, this)); #endif #ifndef QT_NO_MENUBAR if (QMenuBar *mb = qobject_cast(d->causedPopup.widget)) diff --git a/src/widgets/widgets/qprogressbar.cpp b/src/widgets/widgets/qprogressbar.cpp index 816b847cf5..c1a34bfb7a 100644 --- a/src/widgets/widgets/qprogressbar.cpp +++ b/src/widgets/widgets/qprogressbar.cpp @@ -314,7 +314,7 @@ void QProgressBar::setValue(int value) d->value = value; emit valueChanged(value); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this, 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::ValueChanged, this)); #endif if (d->repaintRequired()) repaint(); diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 73c3d14f9b..a04339f864 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -768,7 +768,7 @@ void QWidgetLineControl::internalSetText(const QString &txt, int pos, bool edite #ifndef QT_NO_ACCESSIBILITY if (changed) - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextUpdated, parent(), 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextUpdated, parent())); #endif } @@ -1367,7 +1367,7 @@ void QWidgetLineControl::emitCursorPositionChanged() m_lastCursorPos = m_cursor; cursorPositionChanged(oldLast, m_cursor); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextCaretMoved, parent(), 0)); + QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::TextCaretMoved, parent())); #endif } } diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index 4c370bebc7..3e3fce2e1c 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -415,7 +415,7 @@ void tst_QAccessibility::eventTest() button->setObjectName(QString("Olaf")); button->show(); - QVERIFY_EVENT(button, 0, QAccessible::ObjectShow); + QVERIFY_EVENT(button, -1, QAccessible::ObjectShow); button->setFocus(Qt::MouseFocusReason); QTestAccessibility::clearEvents(); QTest::mouseClick(button, Qt::LeftButton, 0); @@ -423,12 +423,12 @@ void tst_QAccessibility::eventTest() QVERIFY_EVENT(button, 0, QAccessible::StateChanged); button->setAccessibleName("Olaf the second"); - QVERIFY_EVENT(button, 0, QAccessible::NameChanged); + QVERIFY_EVENT(button, -1, QAccessible::NameChanged); button->setAccessibleDescription("This is a button labeled Olaf"); - QVERIFY_EVENT(button, 0, QAccessible::DescriptionChanged); + QVERIFY_EVENT(button, -1, QAccessible::DescriptionChanged); button->hide(); - QVERIFY_EVENT(button, 0, QAccessible::ObjectHide); + QVERIFY_EVENT(button, -1, QAccessible::ObjectHide); delete button; } @@ -732,16 +732,16 @@ void tst_QAccessibility::hideShowTest() window->show(); QVERIFY(!state(window).invisible); QVERIFY(!state(child).invisible); - QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, 0, QAccessible::ObjectShow))); - QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, 0, QAccessible::ObjectShow))); + QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, -1, QAccessible::ObjectShow))); + QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, -1, QAccessible::ObjectShow))); QTestAccessibility::clearEvents(); // hide() and veryfy that both window and child are invisible and get ObjectHide events. window->hide(); QVERIFY(state(window).invisible); QVERIFY(state(child).invisible); - QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, 0, QAccessible::ObjectHide))); - QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, 0, QAccessible::ObjectHide))); + QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(window, -1, QAccessible::ObjectHide))); + QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(child, -1, QAccessible::ObjectHide))); QTestAccessibility::clearEvents(); delete window; @@ -822,7 +822,7 @@ void tst_QAccessibility::mainWindowTest() QLatin1String name = QLatin1String("I am the main window"); mw->setWindowTitle(name); QTest::qWaitForWindowShown(mw); - QVERIFY_EVENT(mw, 0, QAccessible::ObjectShow); + QVERIFY_EVENT(mw, -1, QAccessible::ObjectShow); QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(mw); QCOMPARE(interface->text(QAccessible::Name), name); @@ -1052,12 +1052,12 @@ void tst_QAccessibility::scrollBarTest() scrollBar->resize(200, 50); scrollBar->show(); QVERIFY(!scrollBarInterface->state().invisible); - QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, 0, QAccessible::ObjectShow))); + QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, -1, QAccessible::ObjectShow))); QTestAccessibility::clearEvents(); scrollBar->hide(); QVERIFY(scrollBarInterface->state().invisible); - QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, 0, QAccessible::ObjectHide))); + QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(scrollBar, -1, QAccessible::ObjectHide))); QTestAccessibility::clearEvents(); // Test that the left/right subcontrols are set to unavailable when the scrollBar is at the minimum/maximum. @@ -1498,7 +1498,7 @@ void tst_QAccessibility::spinBoxTest() QTest::keyPress(spinBox, Qt::Key_Up); QTest::qWait(200); EventList events = QTestAccessibility::events(); - QTestAccessibilityEvent expectedEvent(spinBox, 0, (int)QAccessible::ValueChanged); + QTestAccessibilityEvent expectedEvent(spinBox, -1, (int)QAccessible::ValueChanged); QVERIFY(events.contains(expectedEvent)); delete spinBox; QTestAccessibility::clearEvents(); @@ -1769,7 +1769,7 @@ void tst_QAccessibility::lineEditTest() le->setFocus(Qt::TabFocusReason); QTestAccessibility::clearEvents(); le2->setFocus(Qt::TabFocusReason); - QTRY_VERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(le2, 0, QAccessible::Focus))); + QTRY_VERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(le2, -1, QAccessible::Focus))); le->setText(QLatin1String("500")); le->setValidator(new QIntValidator()); @@ -1789,7 +1789,7 @@ void tst_QAccessibility::lineEditTest() le3->deselect(); le3->setCursorPosition(3); QCOMPARE(textIface->cursorPosition(), 3); - QTRY_VERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(le3, 0, QAccessible::TextCaretMoved))); + QTRY_VERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(le3, -1, QAccessible::TextCaretMoved))); QCOMPARE(textIface->selectionCount(), 0); QTestAccessibility::clearEvents();