Qt-interest Archive, December 2006
Short keys
Message 1 in thread
Hello!
I hope some of you have come upon this Problem. Or Feature, I don't know how
to define it yet.
I would like to have the short keys of an application written with QT behave
in the same manner as in some other windows applications (MS Word by
example).
Instead of "Alt + key" - what default in QT is, I would like to have the
action performed when the user press the "key".
An example: in a QMessageBox::information (), with 2 buttons "&Yes", "&No",
the user must press the Alt + Y or Alt + N. Is there any possibility to
continue only by pressing the Y or N keys? Should I subclass the QMessageBox
class in order to achieve that, or is it any other possibility ?
I'm using QT 4.2 with MS VC++ NET.
Thanks!
Andi
--
[ signature omitted ]
Message 2 in thread
I guess you could subclass QMessageBox and reimplement
keyPressEvent(QKeyEvent *) or use QButton::setAccel(...).
It might be easier just to roll your own by subclassing QDialog.
Sam Dutton
SAM DUTTON
SENIOR SITE DEVELOPER
200 GRAY'S INN ROAD
LONDON
WC1X 8XZ
UNITED KINGDOM
T +44 (0)20 7430 4496
F
E SAM.DUTTON@xxxxxxxxx
WWW.ITN.CO.UK
-----Original Message-----
From: Andi [mailto:b_andi@xxxxxxxxxx]
Sent: Wednesday 20 December 2006 10:12
To: qt-interest@xxxxxxxxxxxxx
Subject: Short keys
Hello!
I hope some of you have come upon this Problem. Or Feature, I don't know
how to define it yet.
I would like to have the short keys of an application written with QT
behave in the same manner as in some other windows applications (MS Word
by example).
Instead of "Alt + key" - what default in QT is, I would like to have the
action performed when the user press the "key".
An example: in a QMessageBox::information (), with 2 buttons "&Yes",
"&No", the user must press the Alt + Y or Alt + N. Is there any
possibility to continue only by pressing the Y or N keys? Should I
subclass the QMessageBox class in order to achieve that, or is it any
other possibility ?
I'm using QT 4.2 with MS VC++ NET.
Thanks!
Andi
--
[ signature omitted ]