Commit b300c1c42168e6a2873d94ff24fae37e75523cd4

  • avatar
  • con <qtc-committer @no…a.com> (Committer)
  • Mon Nov 23 10:01:11 CET 2009
  • avatar
  • Roberto Raggi (Author)
  • Fri Nov 20 15:07:10 CET 2009
Fixed possible crash when using tab to complete (Qt/Carbon only).

Task-number: QTCREATORBUG-199
Reviewed-by: thorbjorn
(cherry picked from commit e2925540675b3c723f46f4f6a21a0cbf3dff26ad)
  
139139
140140 bool forwardKeys = true;
141141 if (e->type() == QEvent::FocusOut) {
142 closeList();
142 QModelIndex index;
143#if defined(Q_OS_DARWIN) && ! defined(QT_MAC_USE_COCOA)
144 QFocusEvent *fe = static_cast<QFocusEvent *>(e);
145 if (fe->reason() == Qt::OtherFocusReason) {
146 // Qt/carbon workaround
147 // focus out is received before the key press event.
148 index = currentIndex();
149 }
150#endif
151 closeList(index);
143152 return true;
144153 } else if (e->type() == QEvent::KeyPress) {
145154 QKeyEvent *ke = static_cast<QKeyEvent *>(e);
162162 case Qt::Key_Tab:
163163 case Qt::Key_Return:
164164 //independently from style, accept current entry if return is pressed
165 closeList(currentIndex());
165 if (qApp->focusWidget() == this)
166 closeList(currentIndex());
166167 return true;
167168 case Qt::Key_Up:
168169 if (currentIndex().row() == 0) {