Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qinputmethod.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QINPUTMETHOD_H
6#define QINPUTMETHOD_H
7
8#include <QtGui/qtguiglobal.h>
9#include <QtCore/qobject.h>
10
11QT_BEGIN_NAMESPACE
12
13class QInputMethodPrivate;
14class QWindow;
15class QRectF;
16class QTransform;
17class QInputMethodQueryEvent;
18
19class Q_GUI_EXPORT QInputMethod : public QObject
20{
21 Q_OBJECT
22 Q_DECLARE_PRIVATE(QInputMethod)
23 Q_PROPERTY(QRectF cursorRectangle READ cursorRectangle NOTIFY cursorRectangleChanged)
24 Q_PROPERTY(QRectF anchorRectangle READ anchorRectangle NOTIFY anchorRectangleChanged)
25 Q_PROPERTY(QRectF keyboardRectangle READ keyboardRectangle NOTIFY keyboardRectangleChanged)
26 Q_PROPERTY(QRectF inputItemClipRectangle READ inputItemClipRectangle
27 NOTIFY inputItemClipRectangleChanged)
28 Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged)
29 Q_PROPERTY(bool animating READ isAnimating NOTIFY animatingChanged)
30 Q_PROPERTY(QLocale locale READ locale NOTIFY localeChanged)
31 Q_PROPERTY(Qt::LayoutDirection inputDirection READ inputDirection NOTIFY inputDirectionChanged)
32
33public:
34 QTransform inputItemTransform() const;
35 void setInputItemTransform(const QTransform &transform);
36
37 QRectF inputItemRectangle() const;
38 void setInputItemRectangle(const QRectF &rect);
39
40 // in window coordinates
41 QRectF cursorRectangle() const; // ### what if we have rotations for the item?
42 QRectF anchorRectangle() const; // ### ditto
43
44 // keyboard geometry in window coords
45 QRectF keyboardRectangle() const;
46
47 QRectF inputItemClipRectangle() const;
49 enum Action {
50 Click,
51 ContextMenu
52 };
53 Q_ENUM(Action)
54
55 bool isVisible() const;
56 void setVisible(bool visible);
57
58 bool isAnimating() const;
59
60 QLocale locale() const;
61 Qt::LayoutDirection inputDirection() const;
62
63 static QVariant queryFocusObject(Qt::InputMethodQuery query, const QVariant &argument);
64
65public Q_SLOTS:
66 void show();
67 void hide();
68
69 void update(Qt::InputMethodQueries queries);
70 void reset();
71 void commit();
72
73 void invokeAction(Action a, int cursorPosition);
74
75Q_SIGNALS:
76 void cursorRectangleChanged();
77 void anchorRectangleChanged();
78 void keyboardRectangleChanged();
79 void inputItemClipRectangleChanged();
80 void visibleChanged();
81 void animatingChanged();
82 void localeChanged();
83 void inputDirectionChanged(Qt::LayoutDirection newDirection);
84
85private:
86 friend class QGuiApplication;
87 friend class QGuiApplicationPrivate;
88 friend class QPlatformInputContext;
89 QInputMethod();
90 ~QInputMethod();
91};
92
93QT_END_NAMESPACE
94
95#endif
The QInputMethod class provides access to the active text input method.
Combined button and popup list for selecting options.
#define qApp
#define qGuiApp
static bool platformSupportsHiddenText()
static QRectF inputMethodQueryRectangle_helper(Qt::InputMethodQuery imquery, const QTransform &xform)