1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
'\" t
.TH QKeySequence 3qt "18 March 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 NAME
QKeySequence \- Encapsulates a key sequence as used by accelerators
.SH SYNOPSIS
\fC#include <qkeysequence.h>\fR
.PP
Inherits Qt.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQKeySequence\fR ()"
.br
.ti -1c
.BI "\fBQKeySequence\fR ( const QString & key )"
.br
.ti -1c
.BI "\fBQKeySequence\fR ( int key )"
.br
.ti -1c
.BI "\fBoperator QString\fR () const"
.br
.ti -1c
.BI "\fBoperator int\fR () const"
.br
.ti -1c
.BI "\fBQKeySequence\fR ( const QKeySequence & keysequence )"
.br
.ti -1c
.BI "QKeySequence & \fBoperator=\fR ( const QKeySequence & keysequence )"
.br
.ti -1c
.BI "\fB~QKeySequence\fR ()"
.br
.ti -1c
.BI "bool \fBoperator==\fR ( const QKeySequence & keysequence ) const"
.br
.ti -1c
.BI "bool \fBoperator!=\fR ( const QKeySequence & keysequence ) const"
.br
.in -1c
.SH RELATED FUNCTION DOCUMENTATION
.in +1c
.ti -1c
.BI "QDataStream & \fBoperator<<\fR ( QDataStream & s, const QKeySequence & keysequence )"
.br
.ti -1c
.BI "QDataStream & \fBoperator>>\fR ( QDataStream & s, QKeySequence & keysequence )"
.br
.in -1c
.SH DESCRIPTION
The QKeySequence class encapsulates a key sequence as used by accelerators.
.PP
A key sequence consists of a keyboard code, optionally combined with modifiers, e.g. SHIFT, CTRL, ALT or UNICODE_ACCEL. For example, \fCCTRL + Key_P\fR might be a sequence used as a shortcut for printing a document. The key codes are listed in qnamespace.h. As an alternative, use UNICODE_ACCEL with the unicode code point of the character. For example, \fCUNICODE_ACCEL + 'A'\fR gives the same key sequence as Key_A.
.PP
Key sequences can be constructed either from an integer key code, or from a human readable translatable string. A key sequence can be cast to a QString to obtain a human readable translated version of the sequence. Translations are done in the "QAccel" scope.
.PP
See also QAccel and Miscellaneous Classes.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QKeySequence::QKeySequence ()"
Constructs an empty key sequence.
.SH "QKeySequence::QKeySequence ( const QString & key )"
Creates a key sequence from the string \fIkey\fR. For example "Ctrl+O" gives CTRL+UNICODE_ACCEL+'O'. The strings "Ctrl", "Shift" and "Alt" are recognized, as well as their translated equivalents in the" QAccel" scope (using QObject::tr()).
.PP
This contructor is typically used with tr(), so that accelerator keys can be replaced in translations:
.PP
.nf
.br
QPopupMenu *file = new QPopupMenu( this );
.br
file->insertItem( tr("&Open..."), this, SLOT(open()),
.br
QKeySequence( tr("Ctrl+O", "File|Open") ) );
.br
.fi
.PP
Note the \fC"File|Open"\fR translator comment. It is by no means necessary, but it provides some context for the human translator.
.SH "QKeySequence::QKeySequence ( int key )"
Constructs a key sequence from the keycode \fIkey\fR.
.PP
The key codes are listed in qnamespace.h and can be combined with modifiers, e.g. with SHIFT, CTRL, ALT or UNICODE_ACCEL.
.SH "QKeySequence::QKeySequence ( const QKeySequence & keysequence )"
Copy constructor. Makes a copy of \fIkeysequence\fR.
.SH "QKeySequence::~QKeySequence ()"
Destroys the key sequence.
.SH "QKeySequence::operator QString () const"
Creates an accelerator string for the key sequence. For instance CTRL+Key_O gives "Ctrl+O". The strings, "Ctrl"," Shift", etc. are translated (using QObject::tr()) in the "QAccel" scope.
.SH "QKeySequence::operator int () const"
For backward compatibility: returns the keycode as integer.
.PP
If QKeySequence ever supports more than one keycode, this function will return the first one.
.SH "bool QKeySequence::operator!= ( const QKeySequence & keysequence ) const"
Returns TRUE if \fIkeysequence\fR is not equal to this key sequence; otherwise returns FALSE.
.SH "QKeySequence & QKeySequence::operator= ( const QKeySequence & keysequence )"
Assignment operator. Assigns \fIkeysequence\fR to this object.
.SH "bool QKeySequence::operator== ( const QKeySequence & keysequence ) const"
Returns TRUE if \fIkeysequence\fR is equal to this key sequence; otherwise returns FALSE.
.SH RELATED FUNCTION DOCUMENTATION
.SH "QDataStream & operator<< ( QDataStream & s, const QKeySequence & keysequence )"
Writes the key sequence \fIkeysequence\fR to the stream \fIs\fR.
.PP
Format of the QDataStream operators
.SH "QDataStream & operator>> ( QDataStream & s, QKeySequence & keysequence )"
Reads a key sequence from the stream \fIs\fR into the key sequence \fIkeysequence\fR.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qkeysequence.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If 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.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (qkeysequence.3qt) and the Qt
version (3.0.3).
|