Commit b300c1c42168e6a2873d94ff24fae37e75523cd4
| |   |
| 139 | 139 | |
| 140 | 140 | bool forwardKeys = true; |
| 141 | 141 | if (e->type() == QEvent::FocusOut) { |
| closeList(); |
| QModelIndex index; |
| #if defined(Q_OS_DARWIN) && ! defined(QT_MAC_USE_COCOA) |
| QFocusEvent *fe = static_cast<QFocusEvent *>(e); |
| if (fe->reason() == Qt::OtherFocusReason) { |
| // Qt/carbon workaround |
| // focus out is received before the key press event. |
| index = currentIndex(); |
| } |
| #endif |
| closeList(index); |
| 143 | 152 | return true; |
| 144 | 153 | } else if (e->type() == QEvent::KeyPress) { |
| 145 | 154 | QKeyEvent *ke = static_cast<QKeyEvent *>(e); |
| … | … | |
| 162 | 162 | case Qt::Key_Tab: |
| 163 | 163 | case Qt::Key_Return: |
| 164 | 164 | //independently from style, accept current entry if return is pressed |
| closeList(currentIndex()); |
| if (qApp->focusWidget() == this) |
| closeList(currentIndex()); |
| 166 | 167 | return true; |
| 167 | 168 | case Qt::Key_Up: |
| 168 | 169 | if (currentIndex().row() == 0) { |