This library is no longer being developed or maintained.
Alt_Key library consists of four files:
public API is in
alt_key.hpp and uses the
The library is supplied along with the examples for the book Advanced Qt Programming. Many of the book's examples use the library. The library is also used by the Alt_Key GUI application.
Here is a list of menu options before and after
Alt_Key has added
|Save &As...||Save &As...|
|Copy to Clipboard||Copy &to Clipboard|
|Set Options...||Set &Options...|
Notice that the "Save &As" option already had an accelerator: The
Alt_Key library respects manually inserted accelerators.
kuhn_munkres.hppfile. Either copy the four files into your project or soft link them or add them to your include path.
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ. All the functions that take an alphabet argument use this as their default value. If you choose to use a different alphabet you may only use uppercase letters (or no-case letters for languages that don't distinguish case).
AQP::_Alphabetclass; the class provides a single method which is a
QStringconversion function, so in most cases it can be used wherever a
QStringis expected. The reason for this change is to make the alphabet string translatable.)
These are the most commonly used functions provided by the
void AQP::accelerateActions(QList<QAction*> actions, const QString &alphabet=Alphabet)
void AQP::accelerateMenu(QWidget *menuOrMenuBar, const QString &alphabet=Alphabet)
void AQP::accelerateWidget(QWidget *widget, const QString &alphabet=Alphabet)
QDialogsubclass) and optionally an alphabet. It adds keyboard accelerators to every buddy label, button (i.e., all
QAbstractButtonsubclasses apart from
QToolButton), checkbox, checkable group box, and radio button, that is a child of the widget (or grandchild, recursively), wherever possible. Existing accelerators are respected as are plain ampersands (which are represented by
void AQP::accelerateWidgets(QList<QWidget*> widgets, const QString &alphabet=Alphabet)
These functions are occassionally useful.
QStringList AQP::accelerated(const QStringList &strings, const QString &alphabet=Alphabet)
bool AQP::isValid(const QStringList &strings, QPair<int, int> *where=0, const QString &alphabet=Alphabet)
trueif the given list of strings has valid accelerators. Valid includes no accelerators, but does not include duplicate accelerators. If the
wherepair is passed and the function returns
ints are set to the index of the first string in the list and the index of the character within the string where a problem (e.g., duplicate accelerators) occurred.
int AQP::numberAccelerated(const QStringList &strings)
double AQP::quality(const QStringList &strings)
Your Privacy • Copyright © 2006 Qtrac Ltd. All Rights Reserved.