From kde-core-devel Mon Nov 29 08:53:05 1999 From: David Faure Date: Mon, 29 Nov 1999 08:53:05 +0000 To: kde-core-devel Subject: RE: KAction and KAccel X-MARC-Message: https://marc.info/?l=kde-core-devel&m=94387629910497 > On Sun, 28 Nov 1999, Kurt Granroth wrote: > > > Okay, so I've been fooling around with KAction as it kicks > ass.. but I > > can't seem to get it to play along with KAccel at all :-( > > > > So question to KAccel gurus (David and Simon, maybe?): how do I use > > KAccel with KAction? > > > > I tried something like the following: > > > > m_accelKeys->connectItem(KAccel::Open, this, SLOT(fileOpen())); > > open_act = new KAction(i18n("&Open..."), > QIconSet(BarIcon("fileopen")), > > KAccel::Open, this, > SLOT(fileOpen()), this); > > open_act->plug(m_file); > > open_act->plug(toolBar()); > > > > And it all worked EXCEPT the keyboard accel. The menu shows just > > garbage where it should show CTRL-O > > KAccel::Open is an enum with the value "1" ;-) I'm not really sure if it > is equal to the Qt key binding CTRL+Key_O ;-) Hehe :-) What you want, Kurt, is : KStdAccel::open() > > (and while I'm at it, why do I need two 'this' pointers? what do each > > of them mean?) > > The first "this" is part of the signal/slot connection (the destination > object) and the second this makes the KAction a child object (QObject) of > "this" . > > Bye, > Simon > -- David Faure faure@kde.org - KDE developer david@mandrakesoft.com - Mandrake david.faure@cramersystems.com - Cramer Systems