diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-04 12:33:24 +0200 |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-04 12:33:24 +0200 |
commit | 67ae1b0dac175f48875507f3187ed49276a29ddf (patch) | |
tree | f8367c5f583a7d279ad137ec88517f36004ca89b /src/gui/widgets/qlineedit.cpp | |
parent | 4aafbd6222e7aeafd59a4a4356ba8c53b2bfa1d1 (diff) | |
download | qt4-tools-67ae1b0dac175f48875507f3187ed49276a29ddf.tar.gz |
Fix more compile breakages after merging qt/master-stable.
A lot of the logic was factored out of QLineEdit(Private) and into a
private class called QLineControl, however the changes did not compile
when keypad navigation is enabled so fix them.
Diffstat (limited to 'src/gui/widgets/qlineedit.cpp')
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 01d4890587..8ab30fa471 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1665,12 +1665,12 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const case Qt::ImMaximumTextLength: return QVariant(maxLength()); case Qt::ImAnchorPosition: - if (d->selstart == d->selend) - return QVariant(d->cursor); - else if (d->selstart == d->cursor) - return QVariant(d->selend); + if (d->control->selectionStart() == d->control->selectionEnd()) + return QVariant(d->control->cursor()); + else if (d->control->selectionStart() == d->control->cursor()) + return QVariant(d->control->selectionEnd()); else - return QVariant(d->selstart); + return QVariant(d->control->selectionStart()); default: return QVariant(); } @@ -1695,8 +1695,10 @@ void QLineEdit::focusInEvent(QFocusEvent *e) #ifdef QT_KEYPAD_NAVIGATION if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && e->reason() == Qt::PopupFocusReason)) #endif - int cft = QApplication::cursorFlashTime(); - d->control->setCursorBlinkPeriod(cft/2); + { + int cft = QApplication::cursorFlashTime(); + d->control->setCursorBlinkPeriod(cft/2); + } QStyleOptionFrameV2 opt; initStyleOption(&opt); if((!hasSelectedText() && d->control->preeditAreaText().isEmpty()) @@ -1707,7 +1709,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e) qt_mac_secure_keyboard(true); #endif #ifdef QT_KEYPAD_NAVIGATION - d->control->setCancelText(d->text); + d->control->setCancelText(d->control->text()); #endif #ifndef QT_NO_COMPLETER if (d->control->completer()) { |