src/gui/widgets/qtextedit.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
  1210             }
  1210             }
  1211             break;
  1211             break;
  1212         default:
  1212         default:
  1213             if (QApplication::keypadNavigationEnabled()) {
  1213             if (QApplication::keypadNavigationEnabled()) {
  1214                 if (!hasEditFocus() && !(e->modifiers() & Qt::ControlModifier)) {
  1214                 if (!hasEditFocus() && !(e->modifiers() & Qt::ControlModifier)) {
  1215                     if (e->text()[0].isPrint()) {
  1215                     if (e->text()[0].isPrint())
  1216                         setEditFocus(true);
  1216                         setEditFocus(true);
  1217 #ifndef Q_OS_SYMBIAN
  1217                     else {
  1218                         clear();
       
  1219 #endif
       
  1220                     } else {
       
  1221                         e->ignore();
  1218                         e->ignore();
  1222                         return;
  1219                         return;
  1223                     }
  1220                     }
  1224                 }
  1221                 }
  1225             }
  1222             }
  1675 {
  1672 {
  1676     Q_D(QTextEdit);
  1673     Q_D(QTextEdit);
  1677 #ifdef QT_KEYPAD_NAVIGATION
  1674 #ifdef QT_KEYPAD_NAVIGATION
  1678     if (d->control->textInteractionFlags() & Qt::TextEditable
  1675     if (d->control->textInteractionFlags() & Qt::TextEditable
  1679         && QApplication::keypadNavigationEnabled()
  1676         && QApplication::keypadNavigationEnabled()
  1680         && !hasEditFocus()) {
  1677         && !hasEditFocus())
  1681         setEditFocus(true);
  1678         setEditFocus(true);
  1682 #ifndef Q_OS_SYMBIAN
       
  1683         selectAll();    // so text is replaced rather than appended to
       
  1684 #endif
       
  1685     }
       
  1686 #endif
  1679 #endif
  1687     d->sendControlEvent(e);
  1680     d->sendControlEvent(e);
  1688     ensureCursorVisible();
  1681     ensureCursorVisible();
  1689 }
  1682 }
  1690 
  1683