[][src]Struct qt_gui::QInputMethod

#[repr(C)]
pub struct QInputMethod { /* fields omitted */ }

The QInputMethod class provides access to the active text input method.

C++ class: QInputMethod.

C++ documentation:

The QInputMethod class provides access to the active text input method.

QInputMethod 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.

Qt Quick also provides access to QInputMethod in QML through Qt global object as Qt.inputMethod property.

Methods

impl QInputMethod[src]

pub fn slot_show(&self) -> Receiver<()>[src]

Requests virtual keyboard to open. If the platform doesn't provide virtual keyboard the visibility remains false.

Returns a built-in Qt slot QInputMethod::show that can be passed to qt_core::Signal::connect.

C++ documentation:

Requests virtual keyboard to open. If the platform doesn't provide virtual keyboard the visibility remains false.

Normally applications should not need to call this function, keyboard should automatically open when the text editor gains focus.

pub fn slot_hide(&self) -> Receiver<()>[src]

Requests virtual keyboard to close.

Returns a built-in Qt slot QInputMethod::hide that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

pub fn slot_update(&self) -> Receiver<(c_int,)>[src]

Called by the input item to inform the platform input methods when there has been state changes in editor's input method query attributes. When calling the function queries parameter has to be used to tell what has changes, which input method can use to make queries for attributes it's interested with QInputMethodQueryEvent.

Returns a built-in Qt slot QInputMethod::update that can be passed to qt_core::Signal::connect.

C++ documentation:

Called by the input item to inform the platform input methods when there has been state changes in editor's input method query attributes. When calling the function queries parameter has to be used to tell what has changes, which input method can use to make queries for attributes it's interested with QInputMethodQueryEvent.

In particular calling update whenever the cursor position changes is important as that often causes other query attributes like surrounding text and text selection to change as well. The attributes that often change together with cursor position have been grouped in Qt::ImQueryInput value for convenience.

pub fn slot_reset(&self) -> Receiver<()>[src]

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.

Returns a built-in Qt slot QInputMethod::reset that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

Input method resets automatically when the focused editor changes.

pub fn slot_commit(&self) -> Receiver<()>[src]

Commits the word user is currently composing to the editor. The function 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.

Returns a built-in Qt slot QInputMethod::commit that can be passed to qt_core::Signal::connect.

C++ documentation:

Commits the word user is currently composing to the editor. The function 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.

pub fn slot_invoke_action(&self) -> Receiver<(Action, c_int)>[src]

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.

Returns a built-in Qt slot QInputMethod::invokeAction that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

pub fn cursor_rectangle_changed(&self) -> Signal<()>[src]

Input item's cursor rectangle in window coordinates.

Returns a built-in Qt signal QInputMethod::cursorRectangleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

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.

Access functions:

QRectF cursorRectangle() const

Notifier signal:

void cursorRectangleChanged()

pub fn anchor_rectangle_changed(&self) -> Signal<()>[src]

Input item's anchor rectangle in window coordinates.

Returns a built-in Qt signal QInputMethod::anchorRectangleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

Input item's anchor rectangle in window coordinates.

Anchor rectangle is often used by various text editing controls like text prediction popups for following the text selection.

Access functions:

QRectF anchorRectangle() const

Notifier signal:

void anchorRectangleChanged()

pub fn keyboard_rectangle_changed(&self) -> Signal<()>[src]

Virtual keyboard's geometry in window coordinates.

Returns a built-in Qt signal QInputMethod::keyboardRectangleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

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. This is the case for a floating keyboard on android.

Access functions:

QRectF keyboardRectangle() const

Notifier signal:

void keyboardRectangleChanged()

pub fn input_item_clip_rectangle_changed(&self) -> Signal<()>[src]

Input item's clipped rectangle in window coordinates.

Returns a built-in Qt signal QInputMethod::inputItemClipRectangleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

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).

Access functions:

QRectF inputItemClipRectangle() const

Notifier signal:

void inputItemClipRectangleChanged()

pub fn visible_changed(&self) -> Signal<()>[src]

Virtual keyboard's visibility on the screen

Returns a built-in Qt signal QInputMethod::visibleChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

Virtual keyboard's visibility on the screen

Input method visibility remains false for devices with no virtual keyboards.

Access functions:

bool isVisible() const

Notifier signal:

void visibleChanged()

See also show() and hide().

pub fn animating_changed(&self) -> Signal<()>[src]

True when the virtual keyboard is being opened or closed.

Returns a built-in Qt signal QInputMethod::animatingChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

True when the virtual keyboard is being opened or closed.

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.

Access functions:

bool isAnimating() const

Notifier signal:

void animatingChanged()

pub fn locale_changed(&self) -> Signal<()>[src]

Current input locale.

Returns a built-in Qt signal QInputMethod::localeChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

Current input locale.

Access functions:

QLocale locale() const

Notifier signal:

void localeChanged()

pub fn input_direction_changed(&self) -> Signal<(LayoutDirection,)>[src]

Current input direction.

Returns a built-in Qt signal QInputMethod::inputDirectionChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

Current input direction.

Access functions:

Qt::LayoutDirection inputDirection() const

Notifier signal:

void inputDirectionChanged(Qt::LayoutDirection newDirection)

pub unsafe fn anchor_rectangle(&self) -> CppBox<QRectF>[src]

Input item's anchor rectangle in window coordinates.

Calls C++ function: QRectF QInputMethod::anchorRectangle() const.

C++ documentation:

Input item's anchor rectangle in window coordinates.

Anchor rectangle is often used by various text editing controls like text prediction popups for following the text selection.

Access functions:

QRectF anchorRectangle() const

Notifier signal:

void anchorRectangleChanged()

pub unsafe fn commit(&mut self)[src]

Commits the word user is currently composing to the editor. The function 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.

Calls C++ function: [slot] void QInputMethod::commit().

C++ documentation:

Commits the word user is currently composing to the editor. The function 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.

pub unsafe fn cursor_rectangle(&self) -> CppBox<QRectF>[src]

Input item's cursor rectangle in window coordinates.

Calls C++ function: QRectF QInputMethod::cursorRectangle() const.

C++ documentation:

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.

Access functions:

QRectF cursorRectangle() const

Notifier signal:

void cursorRectangleChanged()

pub unsafe fn hide(&mut self)[src]

Requests virtual keyboard to close.

Calls C++ function: [slot] void QInputMethod::hide().

C++ documentation:

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.

pub unsafe fn input_direction(&self) -> LayoutDirection[src]

Current input direction.

Calls C++ function: Qt::LayoutDirection QInputMethod::inputDirection() const.

C++ documentation:

Current input direction.

Access functions:

Qt::LayoutDirection inputDirection() const

Notifier signal:

void inputDirectionChanged(Qt::LayoutDirection newDirection)

pub unsafe fn input_item_clip_rectangle(&self) -> CppBox<QRectF>[src]

Input item's clipped rectangle in window coordinates.

Calls C++ function: QRectF QInputMethod::inputItemClipRectangle() const.

C++ documentation:

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).

Access functions:

QRectF inputItemClipRectangle() const

Notifier signal:

void inputItemClipRectangleChanged()

pub unsafe fn input_item_rectangle(&self) -> CppBox<QRectF>[src]

Returns the input item's geometry in input item coordinates.

Calls C++ function: QRectF QInputMethod::inputItemRectangle() const.

C++ documentation:

Returns the input item's geometry in input item coordinates.

This function was introduced in Qt 5.1.

See also setInputItemRectangle().

pub unsafe fn input_item_transform(&self) -> CppBox<QTransform>[src]

Returns the transformation from input item coordinates to the window coordinates.

Calls C++ function: QTransform QInputMethod::inputItemTransform() const.

C++ documentation:

Returns the transformation from input item coordinates to the window coordinates.

See also setInputItemTransform().

pub unsafe fn invoke_action(&mut self, a: Action, cursor_position: c_int)[src]

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.

Calls C++ function: [slot] void QInputMethod::invokeAction(QInputMethod::Action a, int cursorPosition).

C++ documentation:

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.

pub unsafe fn is_animating(&self) -> bool[src]

True when the virtual keyboard is being opened or closed.

Calls C++ function: bool QInputMethod::isAnimating() const.

C++ documentation:

True when the virtual keyboard is being opened or closed.

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.

Access functions:

bool isAnimating() const

Notifier signal:

void animatingChanged()

pub unsafe fn is_visible(&self) -> bool[src]

Virtual keyboard's visibility on the screen

Calls C++ function: bool QInputMethod::isVisible() const.

C++ documentation:

Virtual keyboard's visibility on the screen

Input method visibility remains false for devices with no virtual keyboards.

Access functions:

bool isVisible() const

Notifier signal:

void visibleChanged()

See also show() and hide().

pub unsafe fn keyboard_rectangle(&self) -> CppBox<QRectF>[src]

Virtual keyboard's geometry in window coordinates.

Calls C++ function: QRectF QInputMethod::keyboardRectangle() const.

C++ documentation:

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. This is the case for a floating keyboard on android.

Access functions:

QRectF keyboardRectangle() const

Notifier signal:

void keyboardRectangleChanged()

pub unsafe fn locale(&self) -> CppBox<QLocale>[src]

Current input locale.

Calls C++ function: QLocale QInputMethod::locale() const.

C++ documentation:

Current input locale.

Access functions:

QLocale locale() const

Notifier signal:

void localeChanged()

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QInputMethod::metaObject() const.

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QInputMethod::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QInputMethod::qt_metacast(const char* arg1).

pub unsafe fn query_focus_object(
    query: InputMethodQuery,
    argument: impl CastInto<Ref<QVariant>>
) -> CppBox<QVariant>
[src]

Send query to the current focus object with parameters argument and return the result.

Calls C++ function: static QVariant QInputMethod::queryFocusObject(Qt::InputMethodQuery query, QVariant argument).

C++ documentation:

Send query to the current focus object with parameters argument and return the result.

pub unsafe fn reset(&mut self)[src]

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.

Calls C++ function: [slot] void QInputMethod::reset().

C++ documentation:

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.

Input method resets automatically when the focused editor changes.

pub unsafe fn set_input_item_rectangle(
    &mut self,
    rect: impl CastInto<Ref<QRectF>>
)
[src]

Sets the input item's geometry to be rect, in input item coordinates. This needs to be updated by the focused window like QQuickCanvas whenever item is moved inside the scene, or focus is changed.

Calls C++ function: void QInputMethod::setInputItemRectangle(const QRectF& rect).

C++ documentation:

Sets the input item's geometry to be rect, in input item coordinates. This needs to be updated by the focused window like QQuickCanvas whenever item is moved inside the scene, or focus is changed.

This function was introduced in Qt 5.1.

See also inputItemRectangle().

pub unsafe fn set_input_item_transform(
    &mut self,
    transform: impl CastInto<Ref<QTransform>>
)
[src]

Sets the transformation from input item coordinates to window coordinates to be transform. Item transform needs to be updated by the focused window like QQuickCanvas whenever item is moved inside the scene.

Calls C++ function: void QInputMethod::setInputItemTransform(const QTransform& transform).

C++ documentation:

Sets the transformation from input item coordinates to window coordinates to be transform. Item transform needs to be updated by the focused window like QQuickCanvas whenever item is moved inside the scene.

See also inputItemTransform().

pub unsafe fn set_visible(&mut self, visible: bool)[src]

Controls the keyboard visibility. Equivalent to calling show() (if visible is true) or hide() (if visible is false).

Calls C++ function: void QInputMethod::setVisible(bool visible).

C++ documentation:

Controls the keyboard visibility. Equivalent to calling show() (if visible is true) or hide() (if visible is false).

See also isVisible(), show(), and hide().

pub unsafe fn show(&mut self)[src]

Requests virtual keyboard to open. If the platform doesn't provide virtual keyboard the visibility remains false.

Calls C++ function: [slot] void QInputMethod::show().

C++ documentation:

Requests virtual keyboard to open. If the platform doesn't provide virtual keyboard the visibility remains false.

Normally applications should not need to call this function, keyboard should automatically open when the text editor gains focus.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QInputMethod::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QInputMethod::trUtf8(const char* s, const char* c, int n).

pub unsafe fn update(&mut self, queries: QFlags<InputMethodQuery>)[src]

Called by the input item to inform the platform input methods when there has been state changes in editor's input method query attributes. When calling the function queries parameter has to be used to tell what has changes, which input method can use to make queries for attributes it's interested with QInputMethodQueryEvent.

Calls C++ function: [slot] void QInputMethod::update(QFlags<Qt::InputMethodQuery> queries).

C++ documentation:

Called by the input item to inform the platform input methods when there has been state changes in editor's input method query attributes. When calling the function queries parameter has to be used to tell what has changes, which input method can use to make queries for attributes it's interested with QInputMethodQueryEvent.

In particular calling update whenever the cursor position changes is important as that often causes other query attributes like surrounding text and text selection to change as well. The attributes that often change together with cursor position have been grouped in Qt::ImQueryInput value for convenience.

Trait Implementations

impl Deref for QInputMethod[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QInputMethod* ptr).

impl DerefMut for QInputMethod[src]

fn deref_mut(&mut self) -> &mut QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QInputMethod* ptr).

impl DynamicCast<QInputMethod> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QInputMethod>[src]

Calls C++ function: QInputMethod* dynamic_cast<QInputMethod*>(QObject* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QInputMethod>[src]

Calls C++ function: QInputMethod* dynamic_cast<QInputMethod*>(QObject* ptr).

impl StaticDowncast<QInputMethod> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QInputMethod>[src]

Calls C++ function: QInputMethod* static_cast<QInputMethod*>(QObject* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QInputMethod>[src]

Calls C++ function: QInputMethod* static_cast<QInputMethod*>(QObject* ptr).

impl StaticUpcast<QObject> for QInputMethod[src]

unsafe fn static_upcast(ptr: Ptr<QInputMethod>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QInputMethod* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QInputMethod>) -> MutPtr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QInputMethod* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.