summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@theqtcompany.com>2016-04-27 10:41:56 +0200
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2016-05-02 11:00:41 +0000
commit9180797247ebad855bf9713dd5574f9eef5296f2 (patch)
treece2d06358df19aa66a6fe7373dc12baa64ef0d11 /src/gui
parenteb63c0fa4761fa5a8505a594ea5fd861af474533 (diff)
Add QInputMethod::inputItemClipRectangle()
This property allows a convenient way of getting notified about changes in the input item clipped rectangle, similar to QIM::cursorRectangle(). Change-Id: I26bf97eeb1f5ef1b7d3aafb03565023091d6df3d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qinputmethod.cpp14
-rw-r--r--src/gui/kernel/qinputmethod.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp
index b81e166d3a..365b088840 100644
--- a/src/gui/kernel/qinputmethod.cpp
+++ b/src/gui/kernel/qinputmethod.cpp
@@ -183,6 +183,18 @@ QRectF QInputMethod::keyboardRectangle() const
}
/*!
+ \property QInputMethod::inputItemClipRectangle
+ \brief Input item's clipped rectangle in window coordinates.
+
+ The clipped input rectangle is often used by various input methods to determine
+ how much screen real estate is available for the input method (e.g. Virtual Keyboard).
+*/
+QRectF QInputMethod::inputItemClipRectangle() const
+{
+ Q_D(const QInputMethod);
+ return inputMethodQueryRectangle_helper(Qt::ImInputItemClipRectangle, d->inputItemTransform);
+}
+/*!
Requests virtual keyboard to open. If the platform
doesn't provide virtual keyboard the visibility
remains false.
@@ -320,6 +332,8 @@ void QInputMethod::update(Qt::InputMethodQueries queries)
if (queries & (Qt::ImAnchorRectangle))
emit anchorRectangleChanged();
+ if (queries & (Qt::ImInputItemClipRectangle))
+ emit inputItemClipRectangleChanged();
}
/*!
diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h
index 22e4677eaa..1a63d1314e 100644
--- a/src/gui/kernel/qinputmethod.h
+++ b/src/gui/kernel/qinputmethod.h
@@ -57,6 +57,7 @@ class Q_GUI_EXPORT QInputMethod : public QObject
Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
Q_PROPERTY(QRectF anchorRectangle READ anchorRectangle NOTIFY anchorRectangleChanged)
Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
+ Q_PROPERTY(QRectF inputItemClipRectangle READ inputItemClipRectangle NOTIFY inputItemClipRectangleChanged)
Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged)
Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
@@ -76,6 +77,8 @@ public:
// keyboard geometry in window coords
QRectF keyboardRectangle() const;
+ QRectF inputItemClipRectangle() const;
+
enum Action {
Click,
ContextMenu
@@ -106,6 +109,7 @@ Q_SIGNALS:
void cursorRectangleChanged();
void anchorRectangleChanged();
void keyboardRectangleChanged();
+ void inputItemClipRectangleChanged();
void visibleChanged();
void animatingChanged();
void localeChanged();