Métodos públicos |
| QKeySequence () |
| QKeySequence (const QString &key) |
| QKeySequence (int key) |
| QKeySequence (int k1, int k2, int k3=0, int k4=0) |
| QKeySequence (const QKeySequence &) |
| ~QKeySequence () |
uint | count () const |
bool | isEmpty () const |
Qt::SequenceMatch | matches (const QKeySequence &) const |
| operator QString () const |
| operator int () const |
int | operator[] (uint) const |
QKeySequence & | operator= (const QKeySequence &) |
bool | operator== (const QKeySequence &) const |
bool | operator!= (const QKeySequence &) const |
| QKeySequence () |
| QKeySequence (const QString &key) |
| QKeySequence (int key) |
| QKeySequence (int k1, int k2, int k3=0, int k4=0) |
| QKeySequence (const QKeySequence &) |
| ~QKeySequence () |
uint | count () const |
bool | isEmpty () const |
Qt::SequenceMatch | matches (const QKeySequence &) const |
| operator QString () const |
| operator int () const |
int | operator[] (uint) const |
QKeySequence & | operator= (const QKeySequence &) |
bool | operator== (const QKeySequence &) const |
bool | operator!= (const QKeySequence &) const |
Amigas |
class | QAccelManager |
Q_EXPORT QDataStream & | operator<< (QDataStream &, const QKeySequence &) |
Q_EXPORT QDataStream & | operator>> (QDataStream &, QKeySequence &) |
Q_EXPORT QDataStream & | operator<< (QDataStream &, const QKeySequence &) |
Q_EXPORT QDataStream & | operator>> (QDataStream &, QKeySequence &) |
The QKeySequence class encapsulates a key sequence as used by accelerators.
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,
{CTRL + Key_P} 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,
{UNICODE_ACCEL + 'A'} 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.
- Ver también:
- QAccel
QKeySequence::QKeySequence |
( |
const QString & |
key | ) |
|
Creates a key sequence from the string key. 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()).
Multiple key codes (up to four) may be entered by separating them with commas, e.g. "Alt+X,Ctrl+S,Q".
This contructor is typically used with tr (), so that accelerator keys can be replaced in translations:
Note the "File|Open"
translator comment. It is by no means necessary, but it provides some context for the human translator.
QKeySequence::QKeySequence |
( |
int |
k1, |
|
|
int |
k2, |
|
|
int |
k3 = 0 , |
|
|
int |
k4 = 0 |
|
) |
| |
Constructs a key sequence with up to 4 keys k1, k2, k3 and k4.
The key codes are listed in
{qnamespace.h} and can be combined with modifiers, e.g. with SHIFT
, CTRL
, ALT
, META
or UNICODE_ACCEL
.
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.
On Mac OS X, the string returned resembles the sequence that is shown in the menubar.
La documentación para esta clase fue generada a partir de los siguientes ficheros: