⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qkeyevent.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
字号:
.TH QKeyEvent 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQKeyEvent \- Parameters that describe a key event.SH SYNOPSIS.br.PP\fC#include <qevent.h>\fR.PPInherits QEvent..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQKeyEvent\fR ( Type " "type" ", int " "key" ", int " "ascii" ", int " "state" ", const QString & text=QString::null, bool " "autorep" "=FALSE, ushort " "count" "=1 )".br.ti -1c.BI "int \fBkey\fR () const".br.ti -1c.BI "int \fBascii\fR () const".br.ti -1c.BI "ButtonState \fBstate\fR () const".br.ti -1c.BI "ButtonState \fBstateAfter\fR () const".br.ti -1c.BI "bool \fBisAccepted\fR () const".br.ti -1c.BI "QString \fBtext\fR () const".br.ti -1c.BI "bool \fBisAutoRepeat\fR () const".br.ti -1c.BI "int \fBcount\fR () const".br.ti -1c.BI "void \fBaccept\fR ()".br.ti -1c.BI "void \fBignore\fR ()".br.in -1c.SH DESCRIPTIONThe QKeyEvent class contains parameters that describe a key event..PPKey events occur when a key is pressed or released when a widget has keyboard input focus..PPA key event contains a special accept flag which tells whether the receiver wants the key. You should call QKeyEvent::ignore() if the key press or release event is not handled by your widget..PPThe QWidget::setEnable() function can be used to enable or disable mouse and keyboard events for a widget..PPThe event handlers QWidget::keyPressEvent() and QWidget::keyReleaseEvent() receive key events..PPSee also: QFocusEvent and QWidget::grabKeyboard()..PPExamples:.(lpicture/picture.cpp.)l.SH MEMBER FUNCTION DOCUMENTATION.SH "QKeyEvent::QKeyEvent ( Type type, int key, int ascii, int state, const QString & text=QString::null, bool autorep=FALSE, ushort count=1 )"Constructs a key event object..PPThe \fItype\fR parameter must be \fCQEvent::KeyPress\fR or \fCQEvent::KeyRelease.\fR.PPIf \fIkey\fR is 0, the event is not a result of a known key (e.g. it may be the result of a compose sequence or keyboard macro)..PP\fItext\fR will be returned by text()..PPIf \fIautorep\fR is TRUE then isAutoRepeat() will be TRUE..PP\fIcount\fR is the number of single keys..PPThe accept flag is set to TRUE..SH "void QKeyEvent::accept ()"Sets the accept flag of the key event object..PPSetting the accept parameter indicates that the receiver of the event wants the key event. Unwanted key events are sent to the parent widget..PPThe accept flag is set by default..PPSee also: ignore()..SH "int QKeyEvent::ascii () const"Returns the ASCII code of the key that was pressed or released. Internationalized software should use text() instead..PPSee also: text()..PPExamples:.(lpicture/picture.cpp.)l.SH "int QKeyEvent::count () const"Returns the number of single keys for this event. If text() is not empty, this is the length of the string. But Qt also compresses auto repeated key presses for non-visible keycodes, such as BackSpace or Delete. It is save to ignore count() and simply react on new key events, but if your application cannot keep up with the system's keyboard repeat rate, the users might feel it is a bit klundgy. Smarter applications therefore check count() and contain fancy code to optimize repetitive keysstrokes, even if the screen update might temporarily fell behind..SH "void QKeyEvent::ignore ()"Clears the accept flag parameter of the key event object..PPClearing the accept parameter indicates that the event receiver does not want the key event. Unwanted key events are sent to the parent widget..PPThe accept flag is set by default..PPSee also: accept()..SH "bool QKeyEvent::isAccepted () const"Returns TRUE if the receiver of the event wants to keep the key..SH "bool QKeyEvent::isAutoRepeat () const"Returns TRUE if the event was generated by the auto-repeat feature of the system. Some applications will choose to ignore events of this type..SH "int QKeyEvent::key () const"Returns the code of the key that was pressed or released..PPThe header file qnamespace.h lists the possible keyboard codes. These codes are independent of the underlying window system..PPKey code 0 means that the event is not a result of a known key (e.g. it may be the result of a compose sequence or keyboard macro)..SH "ButtonState QKeyEvent::state () const"Returns the keyboard modifier flags that existed immediately before the event occurred..PPThe returned value is \fCShiftButton, ControlButton\fR and \fCAltButton\fR OR'ed together..PPSee also: stateAfter()..SH "ButtonState QKeyEvent::stateAfter () const"Returns the keyboard modifier flags that existed immediately after the event occurred..PPSee also: state()..SH "QString QKeyEvent::text () const"Returns the Unicode text which this key generated..PPSee also:  QWidget::setKeyCompression()..SH "SEE ALSO".BR http://www.troll.no/qt/qkeyevent.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -