limit one line without eol according to kateviewinternal.cpp.
it works cool!.
==================================================================================================
QVariant KateViewInternal::inputMethodQuery ( Qt::InputMethodQuery query ) const
{
switch (query) {
case Qt::ImMicroFocus: {
// Cursor placement code is changed for Asian input method that
// shows candidate window. This behavior is same as Qt/E 2.3.7
// which supports Asian input methods. Asian input methods need
// start point of IM selection text to place candidate window as
// adjacent to the selection text.
KTextEditor::Cursor c = m_imPreeditRange ? m_imPreeditRange->start() : m_cursor;
return QRect (cursorToCoordinate(c, true, false), QSize(0, renderer()->lineHeight()));
}
case Qt::ImFont:
return renderer()->currentFont();
case Qt::ImCursorPosition:
return m_imPreeditRange ? m_imPreeditRange->start().column() : 0;
case Qt::ImSurroundingText:
if (Kate::TextLine l = doc()->kateTextLine(m_cursor.line()))
return l->string();
else
return QString();
case Qt::ImCurrentSelection:
if (m_view->selection())
return m_view->selectionText();
else
return QString();
default:
/* values: ImMaximumTextLength and ImAnchorPosition */
break;
}
return QWidget::inputMethodQuery(query);
}
Even one line might be too much long over 1024 bytes.
So rather than this
QVarLengthArray<char,1024> buffer(paraEnd - paraStart + 1);
I think this is better
+ std::string s = sqt->RangeText(feedStart, feedEnd);
n + 1
is greater than 1024."""===========================================================================================
int QInputMethodEvent::replacementLength() const
Returns the number of """characters""" to be replaced in the preedit string.
See also replacementStart() and setCommitString().
int QInputMethodEvent::replacementStart() const
Returns the position at which """characters"""" are to be replaced relative from the start of the preedit string.
See also replacementLength() and setCommitString().
void QInputMethodEvent::setCommitString(const QString & commitString, int replaceFrom = 0, int replaceLength = 0)
============================================================================================
But QTextEdit expects UTF16 length.
so its characters are broken on linux, while it works well on windows.
since currently qt ime for win returns UTF16 length.
Let me put off this thread for the time being.
It is very confusing.
"""character""" should be replaced with "QChar", which is never character.
============================================================================================
int QString::size() const
Returns the number of """characters""" in this string.
============================================================================================
NOW, which is right for Qt reconversion? UTF16 or Character.
Which does Qt ime use?
I find Qt ime uses "character" as "QChar", which is counted by UTF16.
but linux word appears to see "character" on Qt as is, which is counted by UCS4.
I am very confused.
I can not understand this situation!
+ event.setCommitString("", offset, nchar); |
|
|