Disable carbon workarounds on Qt 5.

QT_MAC_USE_COCOA is not defined for Qt 5, which
caused GenericProposalWidget to use a carbon
workaround during key handling.

Add QT_VERSION check. These are the only instances
of QT_MAC_USE_COCOA usage in creator.

Change-Id: I71ee23e14d791166ccd5645c52b152489d7f8f72
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Morten Johan Sorvig
2012-03-20 10:16:04 +01:00
committed by Eike Ziller
parent acd49da492
commit 9e443add91

View File

@@ -512,7 +512,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
{ {
if (e->type() == QEvent::FocusOut) { if (e->type() == QEvent::FocusOut) {
abort(); abort();
#if defined(Q_OS_DARWIN) && ! defined(QT_MAC_USE_COCOA) #if (QT_VERSION < 0x050000) && defined(Q_OS_DARWIN) && ! defined(QT_MAC_USE_COCOA)
QFocusEvent *fe = static_cast<QFocusEvent *>(e); QFocusEvent *fe = static_cast<QFocusEvent *>(e);
if (fe->reason() == Qt::OtherFocusReason) { if (fe->reason() == Qt::OtherFocusReason) {
// Qt/carbon workaround // Qt/carbon workaround
@@ -559,7 +559,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
case Qt::Key_Tab: case Qt::Key_Tab:
case Qt::Key_Return: case Qt::Key_Return:
#if defined(QT_MAC_USE_COCOA) || !defined(Q_OS_DARWIN) #if (QT_VERSION >= 0x050000) || (defined(QT_MAC_USE_COCOA) || !defined(Q_OS_DARWIN))
abort(); abort();
if (d->m_completionListView->currentIndex().isValid()) if (d->m_completionListView->currentIndex().isValid())
emit proposalItemActivated(d->m_model->proposalItem( emit proposalItemActivated(d->m_model->proposalItem(