summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorSteffen Imhof <steffen.imhof@basyskom.com>2014-06-17 09:51:07 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2014-10-28 14:04:27 +0100
commit7f8f476244e551b224b56c7f2bff128bc4d873b8 (patch)
treeefe8e9002ccb90058f295986e2016e383dab2371 /src/widgets
parent3dc4b9ac86968c6a921c546a44c1929ad6684473 (diff)
Compile fix for QT_NO_IM in QtWidgets
Added some #ifdef guards around usages of composeMode(). Change-Id: If2f2d3cae21b270933b38ea67dcc885f5871785f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qlineedit.cpp7
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h2
3 files changed, 10 insertions, 1 deletions
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);
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 75f30599be..e459171e62 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -187,6 +187,7 @@ void QWidgetLineControl::paste(QClipboard::Mode clipboardMode)
*/
void QWidgetLineControl::commitPreedit()
{
+#ifndef QT_NO_IM
if (!composeMode())
return;
@@ -198,6 +199,7 @@ void QWidgetLineControl::commitPreedit()
setPreeditArea(-1, QString());
m_textLayout.clearAdditionalFormats();
updateDisplayText(/*force*/ true);
+#endif
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index 1cee67bfd2..5ce1d0ed56 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -221,8 +221,10 @@ public:
}
void setText(const QString &txt)
{
+#ifndef QT_NO_IM
if (composeMode())
qApp->inputMethod()->reset();
+#endif
internalSetText(txt, -1, false);
}
void commitPreedit();