forked from qt-creator/qt-creator
GenericProposalWidget: Delete old code for carbon qt
Change-Id: Ib8cc14764a3ff590e74c581792562ee8ead969b1 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -549,27 +549,10 @@ void GenericProposalWidget::turnOnAutoWidth()
|
|||||||
updatePositionAndSize();
|
updatePositionAndSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool useCarbonWorkaround()
|
|
||||||
{
|
|
||||||
#if (QT_VERSION < 0x050000) && defined(Q_OS_DARWIN) && ! defined(QT_MAC_USE_COCOA)
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
|
bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if (e->type() == QEvent::FocusOut) {
|
if (e->type() == QEvent::FocusOut) {
|
||||||
abort();
|
abort();
|
||||||
if (useCarbonWorkaround()) {
|
|
||||||
QFocusEvent *fe = static_cast<QFocusEvent *>(e);
|
|
||||||
if (fe->reason() == Qt::OtherFocusReason) {
|
|
||||||
// Qt/carbon workaround
|
|
||||||
// focus out is received before the key press event.
|
|
||||||
activateCurrentProposalItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (d->m_infoFrame)
|
if (d->m_infoFrame)
|
||||||
d->m_infoFrame->close();
|
d->m_infoFrame->close();
|
||||||
return true;
|
return true;
|
||||||
@@ -609,10 +592,8 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
|
|||||||
|
|
||||||
case Qt::Key_Tab:
|
case Qt::Key_Tab:
|
||||||
case Qt::Key_Return:
|
case Qt::Key_Return:
|
||||||
if (!useCarbonWorkaround()) {
|
|
||||||
abort();
|
abort();
|
||||||
activateCurrentProposalItem();
|
activateCurrentProposalItem();
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
|
|||||||
Reference in New Issue
Block a user