src/gui/widgets/qlineedit_p.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
   127 #endif
   127 #endif
   128 
   128 
   129 void QLineEditPrivate::_q_selectionChanged()
   129 void QLineEditPrivate::_q_selectionChanged()
   130 {
   130 {
   131     Q_Q(QLineEdit);
   131     Q_Q(QLineEdit);
   132     if (control->preeditAreaText().isEmpty()) {
   132     if (!control->text().isEmpty() && control->preeditAreaText().isEmpty()) {
   133         QStyleOptionFrameV2 opt;
   133         QStyleOptionFrameV2 opt;
   134         q->initStyleOption(&opt);
   134         q->initStyleOption(&opt);
   135         bool showCursor = control->hasSelectedText() ?
   135         bool showCursor = control->hasSelectedText() ?
   136                           q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q):
   136                           q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q):
   137                           true;
   137                           q->hasFocus();
   138         setCursorVisible(showCursor);
   138         setCursorVisible(showCursor);
   139     }
   139     }
   140 
   140 
   141     emit q->selectionChanged();
   141     emit q->selectionChanged();
   142 }
   142 }