From kde-core-devel Tue Nov 30 09:26:46 1999 From: "David Faure" Date: Tue, 30 Nov 1999 09:26:46 +0000 To: kde-core-devel Subject: RE: KAction and KAccel X-MARC-Message: https://marc.info/?l=kde-core-devel&m=94395407430926 > Okay, thanks to Simon and David's help, I was able to figure out how > to make KAction and KAccel work together. > > For the records (the list archives), here's the core stuff: > > m_accelKeys->insertStdItem(KAccel::Open); > m_accelKeys->insertItem(i18n("Preferences"), "prefs", > Qt::ALT + Qt::Key_P); > > m_openAct = new KAction(i18n("&Open..."), QIconSet(BarIcon("fileopen")), > KStdAccel::open(), this, SLOT(fileOpen()), this); > m_preferencesAct = new KAction(i18n("P&references..."), > m_accelKeys->currentKey("prefs"), > this, SLOT(optionsPreferences()), this); Excellent. I was wondering about this - all apps using KAction are NOT using KAccel at the moment (ok, except yours now :) ) and they should be converted. Although... Simon and Torben : didn't you say something about a key configuration dialog based on KAction alone ? Hmmm... this wouldn't allow restoring a previously saved configuration. Ok, it's probably better to use KAccel then. I strongly encourage everybody to do the same in his app - I'll do it in konqueror. IIRC the style guide suggest "Options/Configure Keys..." for the menu item calling the config dialog. -- David Faure faure@kde.org - KDE developer david@mandrakesoft.com - Mandrake david.faure@cramersystems.com - Cramer Systems