A key sequence consists of up to four keyboard codes, each optionally combined with modifiers, e.g. SHIFT, CTRL, ALT, META, 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 ntqnamespace.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.
Key sequences can be constructed either from an integer key code, or from a human readable translatable string such as" Ctrl+X,Alt+Space". 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" context.
Creates a key sequence from the string \fIkey\fR. For example" Ctrl+O" gives CTRL+UNICODE_ACCEL+'O'. The strings "Ctrl"," Shift", "Alt" and "Meta" are recognized, as well as their translated equivalents in the "QAccel" context (using QObject::tr()).
.PP
Multiple key codes (up to four) may be entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q".
.PP
This contructor is typically used with tr(), so that accelerator keys can be replaced in translations:
Matches the sequence with \fIseq\fR. Returns Qt::Identical if successful, Qt::PartialMatch for matching but incomplete \fIseq\fR, and Qt::NoMatch if the sequences have nothing in common. Returns Qt::NoMatch if \fIseq\fR is shorter.
.SH "QKeySequence::operator QString () const"
Creates an accelerator string for the key sequence. For instance CTRL+Key_O gives "Ctrl+O". If the key sequence has multiple key codes they are returned comma-separated, e.g." Alt+X, Ctrl+Y, Z". The strings, "Ctrl", "Shift", etc. are translated (using QObject::tr()) in the "QAccel" scope. If the key sequence has no keys, QString::null is returned.
.PP
On Mac OS X, the string returned resembles the sequence that is shown in the menubar.
.SH "QKeySequence::operator int () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
For backward compatibility: returns the first keycode as integer. If the key sequence is empty, 0 is returned.