diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-09-08 10:57:54 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-09-08 11:28:38 +0200 |
commit | 6f65a55fa9a5bf8a547dff2893d49ab405a16af0 (patch) | |
tree | 971efee66ddcb83afd0f664a6dfa4747436619de /src | |
parent | 1b1831500142c995137f5e4b1bc03d21aa08e1e1 (diff) |
Rename ImMicroFocus to ImCursorRectangle
Also set ImhMultiLine on QTextEdit
Change-Id: I04a5a1d69c2048ea94c24210e2b8374f334be1b6
Reviewed-on: http://codereview.qt-project.org/4414
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qnamespace.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qinputpanel.cpp | 4 | ||||
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsinputcontext.cpp | 2 | ||||
-rw-r--r-- | src/widgets/itemviews/qabstractitemview.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qlineedit.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qscrollarea.cpp | 4 | ||||
-rw-r--r-- | src/widgets/widgets/qtextedit.cpp | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 2 |
10 files changed, 14 insertions, 12 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 740579b11d..a4b9cf1777 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1235,7 +1235,8 @@ public: enum InputMethodQuery { ImEnabled = 0x1, - ImMicroFocus = 0x2, + ImCursorRectangle = 0x2, + ImMicroFocus = 0x2, // deprecated ImFont = 0x4, ImCursorPosition = 0x8, ImSurroundingText = 0x10, diff --git a/src/gui/kernel/qinputpanel.cpp b/src/gui/kernel/qinputpanel.cpp index 24300018f6..eda93e005c 100644 --- a/src/gui/kernel/qinputpanel.cpp +++ b/src/gui/kernel/qinputpanel.cpp @@ -99,7 +99,7 @@ QRectF QInputPanel::cursorRectangle() const if (!d->inputItem) return QRectF(); - QInputMethodQueryEvent query(Qt::ImMicroFocus); + QInputMethodQueryEvent query(Qt::ImCursorRectangle); QGuiApplication::sendEvent(d->inputItem.data(), &query); QRect r = query.value().toRect(); if (!r.isValid()) @@ -163,7 +163,7 @@ void QInputPanel::update(Qt::InputMethodQueries queries) if (ic) ic->update(queries); - if (queries & Qt::ImMicroFocus) + if (queries & Qt::ImCursorRectangle) emit cursorRectangleChanged(); } diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index 204f71eced..5a86e843a3 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1907,7 +1907,7 @@ QVariant QTextControl::inputMethodQuery(Qt::InputMethodQuery property) const Q_D(const QTextControl); QTextBlock block = d->cursor.block(); switch(property) { - case Qt::ImMicroFocus: + case Qt::ImCursorRectangle: return cursorRect(); case Qt::ImFont: return QVariant(d->cursor.charFormat().font()); diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp index ec456b1f9c..e3dc100805 100644 --- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp +++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp @@ -212,7 +212,7 @@ void QWindowsInputContext::update() return; // Move candidate list window to the microfocus position. QRect globalMicroFocusRect; - if (!inputMethodQuery(fo, Qt::ImMicroFocus, &globalMicroFocusRect) || !globalMicroFocusRect.isValid()) + if (!inputMethodQuery(fo, Qt::ImCursorRectangle, &globalMicroFocusRect) || !globalMicroFocusRect.isValid()) return; if (QWindowsContext::verboseInputMethods) qDebug() << __FUNCTION__ << himc << globalMicroFocusRect; diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 75e2921896..d6fbb7c953 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -863,7 +863,7 @@ QAbstractItemDelegate *QAbstractItemView::itemDelegate() const QVariant QAbstractItemView::inputMethodQuery(Qt::InputMethodQuery query) const { const QModelIndex current = currentIndex(); - if (!current.isValid() || query != Qt::ImMicroFocus) + if (!current.isValid() || query != Qt::ImCursorRectangle) return QAbstractScrollArea::inputMethodQuery(query); return visualRect(current); } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 0cecce8cfb..125e33f0da 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -8338,7 +8338,7 @@ bool QWidget::event(QEvent *event) if (!k->isAccepted() && k->modifiers() & Qt::ShiftModifier && k->key() == Qt::Key_F1 && d->whatsThis.size()) { - QWhatsThis::showText(mapToGlobal(inputMethodQuery(Qt::ImMicroFocus).toRect().center()), d->whatsThis, this); + QWhatsThis::showText(mapToGlobal(inputMethodQuery(Qt::ImCursorRectangle).toRect().center()), d->whatsThis, this); k->accept(); } #endif @@ -9280,7 +9280,7 @@ void QWidget::inputMethodEvent(QInputMethodEvent *event) QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const { switch(query) { - case Qt::ImMicroFocus: + case Qt::ImCursorRectangle: return QRect(width()/2, 0, 1, height()); case Qt::ImFont: return font(); diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 1ca3886fc5..aca15f30ed 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1757,7 +1757,7 @@ QVariant QLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const { Q_D(const QLineEdit); switch(property) { - case Qt::ImMicroFocus: + case Qt::ImCursorRectangle: return d->cursorRect(); case Qt::ImFont: return font(); diff --git a/src/widgets/widgets/qscrollarea.cpp b/src/widgets/widgets/qscrollarea.cpp index 314f4fe9d2..5d03c07472 100644 --- a/src/widgets/widgets/qscrollarea.cpp +++ b/src/widgets/widgets/qscrollarea.cpp @@ -465,9 +465,9 @@ void QScrollArea::ensureWidgetVisible(QWidget *childWidget, int xmargin, int yma if (!d->widget->isAncestorOf(childWidget)) return; - const QRect microFocus = childWidget->inputMethodQuery(Qt::ImMicroFocus).toRect(); + const QRect microFocus = childWidget->inputMethodQuery(Qt::ImCursorRectangle).toRect(); const QRect defaultMicroFocus = - childWidget->QWidget::inputMethodQuery(Qt::ImMicroFocus).toRect(); + childWidget->QWidget::inputMethodQuery(Qt::ImCursorRectangle).toRect(); QRect focusRect = (microFocus != defaultMicroFocus) ? QRect(childWidget->mapTo(d->widget, microFocus.topLeft()), microFocus.size()) : QRect(childWidget->mapTo(d->widget, QPoint(0,0)), childWidget->size()); diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 72cb326507..67be9dbed3 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -181,6 +181,7 @@ void QTextEditPrivate::init(const QString &html) q->setFocusPolicy(Qt::WheelFocus); q->setAttribute(Qt::WA_KeyCompression); q->setAttribute(Qt::WA_InputMethodEnabled); + q->setInputMethodHints(Qt::ImhMultiLine); #ifndef QT_NO_CURSOR viewport->setCursor(Qt::IBeamCursor); diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 89c64082a4..43ebb6b078 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1983,7 +1983,7 @@ QVariant QWidgetTextControl::inputMethodQuery(Qt::InputMethodQuery property) con Q_D(const QWidgetTextControl); QTextBlock block = d->cursor.block(); switch(property) { - case Qt::ImMicroFocus: + case Qt::ImCursorRectangle: return cursorRect(); case Qt::ImFont: return QVariant(d->cursor.charFormat().font()); |