diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-03-16 10:01:29 +0100 |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2012-03-16 10:01:29 +0100 |
commit | 440f452aa3a5609e5f6006a03ac36d41462d5908 (patch) | |
tree | 598d682291945055e4f6feb08a228212648482c1 /src/widgets/widgets/qcombobox.cpp | |
parent | cd1e62ffc121cc68c5a133a8095d431f04d966ce (diff) | |
parent | d4959fa6376255ab4adf8adaeb2ee47ae6b679d2 (diff) |
Merge master into api_changes
Conflicts:
src/corelib/kernel/qmetatype.cpp
src/gui/kernel/qplatformsurface_qpa.cpp
tests/auto/corelib/tools/qtimeline/qtimeline.pro
Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index c5f5d6e6e1..88c17ca704 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -58,6 +58,7 @@ #include <qtreeview.h> #include <qheaderview.h> #include <qmath.h> +#include <qmetaobject.h> #include <private/qguiapplication_p.h> #include <private/qapplication_p.h> #include <private/qcombobox_p.h> @@ -982,7 +983,8 @@ void QComboBoxPrivate::_q_dataChanged(const QModelIndex &topLeft, const QModelIn q->update(); } #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, q, 0)); + QAccessibleEvent event(QAccessible::NameChanged, q, 0); + QAccessible::updateAccessibility(&event); #endif } @@ -1238,7 +1240,8 @@ void QComboBoxPrivate::_q_emitCurrentIndexChanged(const QModelIndex &index) emit q->currentIndexChanged(index.row()); emit q->currentIndexChanged(itemText(index)); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, q, 0)); + QAccessibleEvent event(QAccessible::NameChanged, q, 0); + QAccessible::updateAccessibility(&event); #endif } @@ -2545,17 +2548,25 @@ void QComboBox::hidePopup() // Fade out. bool needFade = style()->styleHint(QStyle::SH_Menu_FadeOutOnHide); + bool didFade = false; if (needFade) { -#if defined(Q_WS_MAC) - macWindowFade(qt_mac_window_for(d->container)); -#endif // Q_WS_MAC +#if defined(Q_OS_MAC) + QPlatformNativeInterface *platformNativeInterface = qApp->platformNativeInterface(); + int at = platformNativeInterface->metaObject()->indexOfMethod("fadeWindow()"); + if (at != -1) { + QMetaMethod windowFade = platformNativeInterface->metaObject()->method(at); + windowFade.invoke(platformNativeInterface, Q_ARG(QWindow *, d->container->windowHandle())); + didFade = true; + } + +#endif // Q_OS_MAC // Other platform implementations welcome :-) } d->model->blockSignals(false); d->container->itemView()->blockSignals(false); d->container->blockSignals(false); - if (!needFade) + if (!didFade) #endif // QT_NO_EFFECTS // Fade should implicitly hide as well ;-) d->container->hide(); @@ -2578,7 +2589,8 @@ void QComboBox::clear() Q_D(QComboBox); d->model->removeRows(0, d->model->rowCount(d->root), d->root); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0)); + QAccessibleEvent event(QAccessible::NameChanged, this, 0); + QAccessible::updateAccessibility(&event); #endif } @@ -2597,7 +2609,8 @@ void QComboBox::clearEditText() if (d->lineEdit) d->lineEdit->clear(); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0)); + QAccessibleEvent event(QAccessible::NameChanged, this, 0); + QAccessible::updateAccessibility(&event); #endif } @@ -2610,7 +2623,8 @@ void QComboBox::setEditText(const QString &text) if (d->lineEdit) d->lineEdit->setText(text); #ifndef QT_NO_ACCESSIBILITY - QAccessible::updateAccessibility(QAccessibleEvent(QAccessible::NameChanged, this, 0)); + QAccessibleEvent event(QAccessible::NameChanged, this, 0); + QAccessible::updateAccessibility(&event); #endif } |