From a17907829e6b180f2bb4af9a8594996b2a0e531a Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 8 Mar 2012 16:10:10 +0100 Subject: Use pointers for QAccessibleEvent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At least on mac g++ badly wants to copy the event and cannot use the copy ctor. The sensible solution is thus to use pointers. This is in line with QCoreApplication::sendEvent. Change-Id: Icb58852be351ab04ffa17069989d7a07d4b377da Reviewed-by: Jan-Arve Sæther --- src/widgets/dialogs/qdialog.cpp | 9 ++++++--- src/widgets/dialogs/qmessagebox.cpp | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/widgets/dialogs') diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index f1a6a294d2..5d36bc07e8 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -754,7 +754,8 @@ void QDialog::setVisible(bool visible) } #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogStart, this)); + QAccessibleEvent event(QAccessible::DialogStart, this); + QAccessible::updateAccessibility(&event); #endif } else { @@ -762,8 +763,10 @@ void QDialog::setVisible(bool visible) return; #ifndef QT_NO_ACCESSIBILITY - if (isVisible()) - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::DialogEnd, this)); + if (isVisible()) { + QAccessibleEvent event(QAccessible::DialogEnd, this); + QAccessible::updateAccessibility(&event); + } #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 e1b134ee48..040f61dfc5 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1463,7 +1463,8 @@ void QMessageBox::showEvent(QShowEvent *e) d->updateSize(); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::Alert, this)); + QAccessibleEvent event(QAccessible::Alert, this); + QAccessible::updateAccessibility(&event); #endif #ifdef Q_OS_WIN if (const HMENU systemMenu = qt_getWindowsSystemMenu(this)) { -- cgit v1.2.3