summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-09 13:09:34 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-09 13:09:34 (GMT)
commitec0f388dfb14712a144d534296b33df7e6a2df7f (patch)
treeab4d6b9da547a6439ae6f434a69ee3f202d328d7 /src/gui/inputmethod
parent6165ab0203fa80d31f3488ead7e7f7c088c8668c (diff)
parent3b1a0c4877faa9d1d50372f2128c06530ae4b2d4 (diff)
downloadQt-ec0f388dfb14712a144d534296b33df7e6a2df7f.zip
Qt-ec0f388dfb14712a144d534296b33df7e6a2df7f.tar.gz
Qt-ec0f388dfb14712a144d534296b33df7e6a2df7f.tar.bz2
Merge remote branch 'qt/4.6' into qt-master-from-4.6
Conflicts: src/gui/kernel/qcocoapanel_mac.mm src/gui/kernel/qcocoasharedwindowmethods_mac_p.h
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_p.h5
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp28
2 files changed, 17 insertions, 16 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_p.h b/src/gui/inputmethod/qcoefepinputcontext_p.h
index f5034fc..d5243c3 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_p.h
+++ b/src/gui/inputmethod/qcoefepinputcontext_p.h
@@ -96,7 +96,7 @@ protected:
void timerEvent(QTimerEvent *timerEvent);
private:
- void commitCurrentString(bool triggeredBySymbian);
+ void commitCurrentString(bool cancelFepTransaction);
void updateHints(bool mustUpdateInputCapabilities);
void applyHints(Qt::InputMethodHints hints);
void applyFormat(QList<QInputMethodEvent::Attribute> *attributes);
@@ -127,7 +127,7 @@ public:
private:
void DoCommitFepInlineEditL();
MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue);
- void ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType);
+ void ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType);
// From MCoeFepAwareTextEditor_Extension1
public:
@@ -151,7 +151,6 @@ private:
int m_inlinePosition;
MFepInlineTextFormatRetriever *m_formatRetriever;
MFepPointerEventHandlerDuringInlineEdit *m_pointerHandler;
- int m_longPress;
int m_cursorPos;
QBasicTimer m_tempPreeditStringTimeout;
bool m_hasTempPreeditString;
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index e5ab300..2b91711 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -71,7 +71,6 @@ QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
m_inlinePosition(0),
m_formatRetriever(0),
m_pointerHandler(0),
- m_longPress(0),
m_cursorPos(0),
m_hasTempPreeditString(false)
{
@@ -101,7 +100,7 @@ QCoeFepInputContext::~QCoeFepInputContext()
void QCoeFepInputContext::reset()
{
- commitCurrentString(false);
+ commitCurrentString(true);
}
void QCoeFepInputContext::ReportAknEdStateEvent(MAknEdStateObserver::EAknEdwinStateEvent aEventType)
@@ -126,7 +125,7 @@ void QCoeFepInputContext::update()
void QCoeFepInputContext::setFocusWidget(QWidget *w)
{
- commitCurrentString(false);
+ commitCurrentString(true);
QInputContext::setFocusWidget(w);
@@ -219,7 +218,7 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
break;
case Qt::Key_Select:
if (!m_preeditString.isEmpty()) {
- commitCurrentString(false);
+ commitCurrentString(true);
return true;
}
break;
@@ -231,10 +230,11 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
&& focusWidget()->inputMethodHints() & Qt::ImhHiddenText
&& !keyEvent->text().isEmpty()) {
// Send some temporary preedit text in order to make text visible for a moment.
+ m_cursorPos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
m_preeditString = keyEvent->text();
QList<QInputMethodEvent::Attribute> attributes;
QInputMethodEvent imEvent(m_preeditString, attributes);
- QApplication::sendEvent(focusWidget(), &imEvent);
+ sendEvent(imEvent);
m_tempPreeditStringTimeout.start(1000, this);
m_hasTempPreeditString = true;
update();
@@ -293,7 +293,7 @@ void QCoeFepInputContext::mouseHandler( int x, QMouseEvent *event)
Q_ASSERT(focusWidget());
if (event->type() == QEvent::MouseButtonPress && event->button() == Qt::LeftButton) {
- commitCurrentString(false);
+ commitCurrentString(true);
int pos = focusWidget()->inputMethodQuery(Qt::ImCursorPosition).toInt();
QList<QInputMethodEvent::Attribute> attributes;
@@ -739,31 +739,33 @@ void QCoeFepInputContext::GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLin
void QCoeFepInputContext::DoCommitFepInlineEditL()
{
- commitCurrentString(true);
+ commitCurrentString(false);
}
-void QCoeFepInputContext::commitCurrentString(bool triggeredBySymbian)
+void QCoeFepInputContext::commitCurrentString(bool cancelFepTransaction)
{
+ int longPress = 0;
+
if (m_preeditString.size() == 0) {
QWidget *w = focusWidget();
- if (triggeredBySymbian && w) {
+ if (!cancelFepTransaction && w) {
// We must replace the last character only if the input box has already accepted one
if (w->inputMethodQuery(Qt::ImCursorPosition).toInt() != m_cursorPos)
- m_longPress = 1;
+ longPress = 1;
}
return;
}
QList<QInputMethodEvent::Attribute> attributes;
QInputMethodEvent event(QLatin1String(""), attributes);
- event.setCommitString(m_preeditString, 0-m_longPress, m_longPress);
+ event.setCommitString(m_preeditString, 0-longPress, longPress);
m_preeditString.clear();
sendEvent(event);
m_hasTempPreeditString = false;
- m_longPress = 0;
+ longPress = 0;
- if (!triggeredBySymbian) {
+ if (cancelFepTransaction) {
CCoeFep* fep = CCoeEnv::Static()->Fep();
if (fep)
fep->CancelTransaction();