From 7f8f476244e551b224b56c7f2bff128bc4d873b8 Mon Sep 17 00:00:00 2001 From: Steffen Imhof Date: Tue, 17 Jun 2014 09:51:07 +0200 Subject: Compile fix for QT_NO_IM in QtWidgets Added some #ifdef guards around usages of composeMode(). Change-Id: If2f2d3cae21b270933b38ea67dcc885f5871785f Reviewed-by: Marc Mutz --- src/widgets/widgets/qlineedit.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/widgets/widgets/qlineedit.cpp') diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index ba4dbcc878..f1c884e77f 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1528,13 +1528,16 @@ void QLineEdit::mouseMoveEvent(QMouseEvent * e) #else const bool select = (d->imHints & Qt::ImhNoPredictiveText); #endif +#ifndef QT_NO_IM if (d->control->composeMode() && select) { int startPos = d->xToPos(d->mousePressPos.x()); int currentPos = d->xToPos(e->pos().x()); if (startPos != currentPos) d->control->setSelection(startPos, currentPos - startPos); - } else { + } else +#endif + { d->control->moveCursor(d->xToPos(e->pos().x()), select); } } @@ -1585,6 +1588,7 @@ void QLineEdit::mouseDoubleClickEvent(QMouseEvent* e) int position = d->xToPos(e->pos().x()); // exit composition mode +#ifndef QT_NO_IM if (d->control->composeMode()) { int preeditPos = d->control->cursor(); int posInPreedit = position - d->control->cursor(); @@ -1609,6 +1613,7 @@ void QLineEdit::mouseDoubleClickEvent(QMouseEvent* e) position += (sizeChange - preeditLength); } } +#endif if (position >= 0) d->control->selectWordAtPos(position); -- cgit v1.2.3