summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2011-11-09 17:22:40 +0200
committerQt by Nokia <qt-info@nokia.com>2011-11-10 13:07:51 +0100
commita80688799250d516eebf8c6b9f881af5fe06b1d6 (patch)
tree00420031797965d178fb00217eda90e775327a71
parentdc2a1aff9bc6bf18f594f96924f767165bf4581f (diff)
Document QInputMethodQueryEvent class
Change-Id: I6e98f9e690b733a06ee165e5b01ab6a5a784791b Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
-rw-r--r--src/gui/kernel/qevent.cpp34
-rw-r--r--src/gui/kernel/qevent.h4
2 files changed, 28 insertions, 10 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 2c0858ae00..0d26268030 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1721,38 +1721,56 @@ void QInputMethodEvent::setTentativeCommitString(const QString &tentativeCommitS
able to support complex input method operations as support for
surrounding text and reconversions.
- query() specifies which property is queried.
+ queries() specifies which properties are queried.
The object should call setValue() on the event to fill in the requested
data before calling accept().
*/
+
+/*!
+ \fn Qt::InputMethodQueries QInputMethodQueryEvent::queries() const
+
+ Returns the properties queried by the event.
+ */
+
+/*!
+ Constructs a query event for properties given by \a queries.
+ */
QInputMethodQueryEvent::QInputMethodQueryEvent(Qt::InputMethodQueries queries)
: QEvent(InputMethodQuery),
m_queries(queries)
{
}
+/*!
+ \internal
+ */
QInputMethodQueryEvent::~QInputMethodQueryEvent()
{
}
-
-void QInputMethodQueryEvent::setValue(Qt::InputMethodQuery q, const QVariant &v)
+/*!
+ Sets query property to given value.
+ */
+void QInputMethodQueryEvent::setValue(Qt::InputMethodQuery query, const QVariant &value)
{
for (int i = 0; i < m_values.size(); ++i) {
- if (m_values.at(i).query == q) {
- m_values[i].value = v;
+ if (m_values.at(i).query == query) {
+ m_values[i].value = value;
return;
}
}
- QueryPair pair = { q, v };
+ QueryPair pair = { query, value };
m_values.append(pair);
}
-QVariant QInputMethodQueryEvent::value(Qt::InputMethodQuery q) const
+/*!
+ Returns value of a query property.
+ */
+QVariant QInputMethodQueryEvent::value(Qt::InputMethodQuery query) const
{
for (int i = 0; i < m_values.size(); ++i)
- if (m_values.at(i).query == q)
+ if (m_values.at(i).query == query)
return m_values.at(i).value;
return QVariant();
}
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index aad31a90eb..a79a56b771 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -457,8 +457,8 @@ public:
Qt::InputMethodQueries queries() const { return m_queries; }
- void setValue(Qt::InputMethodQuery q, const QVariant &v);
- QVariant value(Qt::InputMethodQuery q) const;
+ void setValue(Qt::InputMethodQuery query, const QVariant &value);
+ QVariant value(Qt::InputMethodQuery query) const;
private:
Qt::InputMethodQueries m_queries;
struct QueryPair {