CopperSpice API
1.9.2
|
The QInputMethod class provides access to the active text input method. More...
Public Signals | |
void | animatingChanged () |
void | cursorRectangleChanged () |
void | inputDirectionChanged (Qt::LayoutDirection newDirection) |
void | keyboardRectangleChanged () |
void | localeChanged () |
void | visibleChanged () |
Public Signals inherited from QObject | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
Public Slots | |
void | commit () |
void | hide () |
void | invokeAction (Action a, int cursorPosition) |
void | reset () |
void | show () |
void | update (Qt::InputMethodQueries queries) |
Public Slots inherited from QObject | |
void | deleteLater () |
Public Methods | |
QRectF | cursorRectangle () const |
Qt::LayoutDirection | inputDirection () const |
QRectF | inputItemRectangle () const |
QTransform | inputItemTransform () const |
bool | isAnimating () const |
bool | isVisible () const |
QRectF | keyboardRectangle () const |
QLocale | locale () const |
void | setInputItemRectangle (const QRectF &rect) |
void | setInputItemTransform (const QTransform &transform) |
void | setVisible (bool visible) |
Public Methods inherited from QObject | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | event (QEvent *event) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
Static Public Methods | |
static QVariant | queryFocusObject (Qt::InputMethodQuery query, QVariant argument) |
Static Public Methods inherited from QObject | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
Properties | |
animating | |
cursorRectangle | |
inputDirection | |
keyboardRectangle | |
locale | |
visible | |
Properties inherited from QObject | |
objectName | |
Friends | |
class | QApplication |
class | QPlatformInputContext |
Additional Inherited Members | |
Protected Methods inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signalMethod) const |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signalMethod) const |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Related Functions inherited from QObject | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QInputMethod class provides access to the active text input method. This class is used by the text editors for integrating to the platform text input methods and more commonly by application views for querying various text input method-related information like virtual keyboard visibility and keyboard dimensions.
|
signal |
This signal is emitted when the value of the animating property is changed.
|
slot |
Commits the word user is currently composing to the editor. The method is mostly needed by the input methods with text prediction features and by the methods where the script used for typing characters is different from the script that actually gets appended to the editor. Any kind of action that interrupts the text composing needs to flush the composing state by calling the commit() function, for example when the cursor is moved elsewhere.
QRectF QInputMethod::cursorRectangle | ( | ) | const |
Returns the value of the cursorRectangle property.
|
signal |
This signal is emitted when the value of the cursorRectangle property is changed.
|
slot |
Requests virtual keyboard to close. Normally applications should not need to call this function, keyboard should automatically close when the text editor loses focus, for example when the parent view is closed.
Qt::LayoutDirection QInputMethod::inputDirection | ( | ) | const |
Returns the value of the inputDirection property.
|
signal |
This signal is emitted when the value of the inputDirection property is changed.
QRectF QInputMethod::inputItemRectangle | ( | ) | const |
Returns the input item's geometry in input item coordinates.
QTransform QInputMethod::inputItemTransform | ( | ) | const |
Returns the transformation from input item coordinates to the window coordinates.
|
slot |
Called by the input item when the word currently being composed is tapped by the user, as indicated by the action a and the given cursorPosition. Input methods often use this information to offer more word suggestions to the user.
bool QInputMethod::isAnimating | ( | ) | const |
Returns the value of the animating property.
bool QInputMethod::isVisible | ( | ) | const |
Returns the value of the visible property.
QRectF QInputMethod::keyboardRectangle | ( | ) | const |
Returns the value of the keyboardRectangle property.
|
signal |
This signal is emitted when the value of the keyboardRectangle property is changed.
QLocale QInputMethod::locale | ( | ) | const |
Returns the value of the locale property.
|
signal |
This signal is emitted when the value of the locale property is changed.
|
static |
Send query to the current focus object with parameters argument and return the result.
|
slot |
Resets the input method state. For example, a text editor normally calls this method before inserting a text to make widget ready to accept a text. The Input method resets automatically when the focused editor changes.
void QInputMethod::setInputItemRectangle | ( | const QRectF & | rect | ) |
Sets the input item's geometry to rect in input item coordinates. This needs to be updated by the focused window whenever an item is moved inside the scene or focus is changed.
void QInputMethod::setInputItemTransform | ( | const QTransform & | transform | ) |
Sets the transformation from input item coordinates to window coordinates to transform. Item transform needs to be updated by the focused window whenever an item is moved inside the scene.
void QInputMethod::setVisible | ( | bool | visible | ) |
Controls the keyboard visibility. Equivalent to calling show() if visible is true or hide() if visible is false.
|
slot |
Requests virtual keyboard to open. If the platform does not provide virtual keyboard the visibility remains false. Normally applications should not need to call this method since the virtual keyboard should automatically open when the text editor gains focus.
|
slot |
This method is called by an input widget when the state of the widget changes. The queries parameter is used to specify what has changed. The current QInputMethod will then query for relevant attributes using a QInputMethodQueryEvent.
Calling update whenever the cursor position changes is required since other attributes like surrounding text and text selection often change.
|
signal |
This signal is emitted when the value of the visible property is changed.
|
Animating is false when keyboard is fully open or closed. When animating is true and visibility is true keyboard is being opened. When animating is true and visibility is false keyboard is being closed.
Properties | Class Methods |
---|---|
read | isAnimating |
notify | animatingChanged |
|
Input item's cursor rectangle in window coordinates. Cursor rectangle is often used by various text editing controls like text prediction popups for following the text being typed.
Properties | Class Methods |
---|---|
read | cursorRectangle |
notify | cursorRectangleChanged |
|
Current input direction.
Properties | Class Methods |
---|---|
read | inputDirection |
notify | inputDirectionChanged |
|
Virtual keyboard's geometry in window coordinates. This might be an empty rectangle if it is not possible to know the geometry of the keyboard.
Properties | Class Methods |
---|---|
read | keyboardRectangle |
notify | keyboardRectangleChanged |
|
Current input locale.
Properties | Class Methods |
---|---|
read | locale |
notify | localeChanged |
|
Virtual keyboard's visibility on the screen. Input method visibility remains false for devices with no virtual keyboards.
Properties | Class Methods |
---|---|
read | isVisible |
notify | visibleChanged |