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

📄 qkeyevent.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QKeyEvent 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQKeyEvent \- Describes a key event.SH SYNOPSIS\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 describes 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 that indicates whether the receiver wants the key event. You should call QKeyEvent::ignore() if the key press or release event is not handled by your widget. A key event is propagated up the parent widget chain until a widget accepts it with QKeyEvent::accept() or an event filter consumes it. Key events for multi media keys are ignored by default. You should call QKeyEvent::accept() if your widget handles those events..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, QWidget::grabKeyboard(), and Event Classes..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 QEvent::KeyPress or QEvent::KeyRelease. If \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). \fIascii\fR is the ASCII code of the key that was pressed or released. \fIstate\fR holds the keyboard modifiers. \fItext\fR is the Unicode text that the key generated. If \fIautorep\fR is TRUE, isAutoRepeat() will be TRUE. \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. We recommend using text() instead..PPSee also text()..PPExample: picture/picture.cpp..SH "int QKeyEvent::count () const"Returns the number of single keys for this event. If text() is not empty, this is simply the length of the string..PPSee also QWidget::setKeyCompression()..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; otherwise returns FALSE.SH "bool QKeyEvent::isAutoRepeat () const"Returns TRUE if this event comes from an auto-repeating key and FALSE if it comes from an initial key press..PPNote that if the event is a multiple-key compressed event that is partly due to auto-repeat, this function could return either TRUE or FALSE indeterminately..SH "int QKeyEvent::key () const"Returns the code of the key that was pressed or released..PPSee Qt::Key for the list of keyboard codes. These codes are independent of the underlying window system..PPKey code 0 means that the event is not the result of a known key (e.g. it may be the result of a compose sequence or a keyboard macro, or due to key event compression)..PPSee also QWidget::setKeyCompression()..PPExample: fileiconview/qfileiconview.cpp..SH "ButtonState QKeyEvent::state () const"Returns the keyboard modifier flags that existed immediately before the event occurred..PPThe returned value is ShiftButton, ControlButton, AltButton and MetaButton OR'ed together..PPSee also stateAfter()..PPExample: fileiconview/qfileiconview.cpp..SH "ButtonState QKeyEvent::stateAfter () const"Returns the keyboard modifier flags that existed immediately after the event occurred..PP\fBWarning:\fR This function cannot be trusted..PPSee also state()..SH "QString QKeyEvent::text () const"Returns the Unicode text that this key generated..PPSee also QWidget::setKeyCompression()..SH "SEE ALSO".BR http://doc.trolltech.com/qkeyevent.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qkeyevent.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

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