[][src]Struct qt_3d_input::QKeyEvent

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

QKeyEvent event type send by KeyBoardHandler.

C++ class: Qt3DInput::QKeyEvent.

C++ documentation:

QKeyEvent event type send by KeyBoardHandler.

Contains parameters that describe a key event

Methods

impl QKeyEvent[src]

pub unsafe fn count(&self) -> c_int[src]

Holds the number of keys involved in this event. If text is not empty, this is simply the length of the string.

Calls C++ function: int Qt3DInput::QKeyEvent::count() const.

C++ documentation:

Holds the number of keys involved in this event. If text is not empty, this is simply the length of the string.

Access functions:

int count() const

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

Setting accepted to true prevents the key event from being propagated to the item's parent.

Calls C++ function: bool Qt3DInput::QKeyEvent::isAccepted() const.

C++ documentation:

Setting accepted to true prevents the key event from being propagated to the item's parent.

Generally, if the item acts on the key event then it should be accepted so that ancestor items do not also respond to the same event.

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)

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

Holds whether this event comes from an auto-repeating key.

Calls C++ function: bool Qt3DInput::QKeyEvent::isAutoRepeat() const.

C++ documentation:

Holds whether this event comes from an auto-repeating key.

Access functions:

bool isAutoRepeat() const

pub unsafe fn key(&self) -> c_int[src]

This property holds the code of the key that was pressed or released.

Calls C++ function: int Qt3DInput::QKeyEvent::key() const.

C++ documentation:

This property holds the code of the key that was pressed or released.

See Qt.Key for the list of keyboard codes.

Access functions:

int key() const

See also QKeyEvent::key.

pub unsafe fn matches(&self, key: StandardKey) -> bool[src]

Returns true if the key event matches the given standard key key_; otherwise returns false.

Calls C++ function: bool Qt3DInput::QKeyEvent::matches(QKeySequence::StandardKey key_) const.

C++ documentation:

Returns true if the key event matches the given standard key key_; otherwise returns false.

See also QKeySequence::StandardKey.

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

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

pub unsafe fn modifiers(&self) -> c_int[src]

This property holds the keyboard modifier flags that existed immediately before the event occurred.

Calls C++ function: int Qt3DInput::QKeyEvent::modifiers() const.

C++ documentation:

This property holds the keyboard modifier flags that existed immediately before the event occurred.

Access functions:

int modifiers() const

See also QKeyEvent::modifiers.

pub unsafe fn native_scan_code(&self) -> u32[src]

This property contains the native scan code of the key that was pressed. It is passed through from QKeyEvent unchanged.

Calls C++ function: quint32 Qt3DInput::QKeyEvent::nativeScanCode() const.

C++ documentation:

This property contains the native scan code of the key that was pressed. It is passed through from QKeyEvent unchanged.

Access functions:

quint32 nativeScanCode() const

pub unsafe fn new_6a(
    type_: Type,
    key: c_int,
    modifiers: QFlags<KeyboardModifier>,
    text: impl CastInto<Ref<QString>>,
    autorep: bool,
    count: c_ushort
) -> QBox<QKeyEvent>
[src]

Default constructs an instance of QKeyEvent.

Calls C++ function: [constructor] void Qt3DInput::QKeyEvent::QKeyEvent(QEvent::Type type, int key, QFlags<Qt::KeyboardModifier> modifiers, const QString& text = …, bool autorep = …, unsigned short count = …).

C++ documentation:

Default constructs an instance of QKeyEvent.

pub unsafe fn new_1a(ke: impl CastInto<Ref<QKeyEvent>>) -> QBox<QKeyEvent>[src]

Copy constructor.

Calls C++ function: [constructor] void Qt3DInput::QKeyEvent::QKeyEvent(const QKeyEvent& ke).

C++ documentation:

Copy constructor.

pub unsafe fn new_5a(
    type_: Type,
    key: c_int,
    modifiers: QFlags<KeyboardModifier>,
    text: impl CastInto<Ref<QString>>,
    autorep: bool
) -> QBox<QKeyEvent>
[src]

Default constructs an instance of QKeyEvent.

Calls C++ function: [constructor] void Qt3DInput::QKeyEvent::QKeyEvent(QEvent::Type type, int key, QFlags<Qt::KeyboardModifier> modifiers, const QString& text = …, bool autorep = …).

C++ documentation:

Default constructs an instance of QKeyEvent.

pub unsafe fn new_4a(
    type_: Type,
    key: c_int,
    modifiers: QFlags<KeyboardModifier>,
    text: impl CastInto<Ref<QString>>
) -> QBox<QKeyEvent>
[src]

Default constructs an instance of QKeyEvent.

Calls C++ function: [constructor] void Qt3DInput::QKeyEvent::QKeyEvent(QEvent::Type type, int key, QFlags<Qt::KeyboardModifier> modifiers, const QString& text = …).

C++ documentation:

Default constructs an instance of QKeyEvent.

pub unsafe fn new_3a(
    type_: Type,
    key: c_int,
    modifiers: QFlags<KeyboardModifier>
) -> QBox<QKeyEvent>
[src]

Default constructs an instance of QKeyEvent.

Calls C++ function: [constructor] void Qt3DInput::QKeyEvent::QKeyEvent(QEvent::Type type, int key, QFlags<Qt::KeyboardModifier> modifiers).

C++ documentation:

Default constructs an instance of QKeyEvent.

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

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

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

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

pub unsafe fn set_accepted(&self, accepted: bool)[src]

Setting accepted to true prevents the key event from being propagated to the item's parent.

Calls C++ function: void Qt3DInput::QKeyEvent::setAccepted(bool accepted).

C++ documentation:

Setting accepted to true prevents the key event from being propagated to the item's parent.

Generally, if the item acts on the key event then it should be accepted so that ancestor items do not also respond to the same event.

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)

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

Returns a reference to the staticMetaObject field.

pub unsafe fn text(&self) -> CppBox<QString>[src]

This property holds the Unicode text that the key generated. The text returned can be an empty string in cases where modifier keys, such as Shift, Control, Alt, and Meta, are being pressed or released. In such cases key will contain a valid value.

Calls C++ function: QString Qt3DInput::QKeyEvent::text() const.

C++ documentation:

This property holds the Unicode text that the key generated. The text returned can be an empty string in cases where modifier keys, such as Shift, Control, Alt, and Meta, are being pressed or released. In such cases key will contain a valid value.

Access functions:

QString text() const

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

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

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

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

pub unsafe fn type_(&self) -> Type[src]

Returns the type of event

Calls C++ function: QEvent::Type Qt3DInput::QKeyEvent::type() const.

C++ documentation:

Returns the type of event

Trait Implementations

impl CppDeletable for QKeyEvent[src]

unsafe fn delete(&self)[src]

Calls C++ function: virtual [destructor] void Qt3DInput::QKeyEvent::~QKeyEvent().

impl Deref for QKeyEvent[src]

type Target = QObject

The resulting type after dereferencing.

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

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

impl DynamicCast<QKeyEvent> for QObject[src]

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

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

impl StaticDowncast<QKeyEvent> for QObject[src]

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

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

impl StaticUpcast<QObject> for QKeyEvent[src]

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

Calls C++ function: QObject* static_cast<QObject*>(Qt3DInput::QKeyEvent* 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.