Hello,
This patch do two things:
1) call "setAttribute(Qt::WA_InputMethodEnabled, true)" in GuiWorkArea
constuctor. This is in replacement for the former Qt3
"setInputMethodEnabled(true)" and I hope that it will solve the accent
problem reported by Jose.
2) Comment out the inputMethodEvent() method which was used for
something completely unrelated to input method:
// needed to make math superscript work on some systems
// ideally, such special coding should not be necessary
if (text == "^")
key = Qt::Key_AsciiCircum;
This code can be transferred to GuiWorkArea::keyPressEvent() if it turns
out to be still needed.
Committing to the younes branch now.
Abdel.
Index: GuiWorkArea.C
===================================================================
--- GuiWorkArea.C (revision 14214)
+++ GuiWorkArea.C (working copy)
@@ -172,6 +172,10 @@
// Start the timer, one-shot.
step_timer_.start(50, true);
}
+
+ // Enables input methods for asian languages.
+ // Must be set when creating custom text editing widgets.
+ setAttribute(Qt::WA_InputMethodEnabled, true);
}
GuiWorkArea::~GuiWorkArea()
@@ -586,11 +590,17 @@
viewport()->update(cursor_x_, cursor_y_, cursor_w_, cursor_h_);
}
-
+/*
void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
{
- QString const & text = e->preeditString();
+ QString const & text = e->commitString();
if (!text.isEmpty()) {
+
+ lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
+ << " preeditString =" << (const char *)
e->preeditString()
+ << " commitString =" << (const char *)
e->commitString()
+ << endl;
+
int key = 0;
// needed to make math superscript work on some systems
// ideally, such special coding should not be necessary
@@ -601,6 +611,7 @@
}
e->accept();
}
+*/
} // namespace frontend
} // namespace lyx
Index: GuiWorkArea.h
===================================================================
--- GuiWorkArea.h (revision 14214)
+++ GuiWorkArea.h (working copy)
@@ -166,7 +166,7 @@
protected:
/// IM events
- void inputMethodEvent(QInputMethodEvent * e);
+// void inputMethodEvent(QInputMethodEvent * e);
public slots: