Newbie question.

William DeVore quartz13163 at yahoo.com
Mon Nov 26 00:52:53 UTC 2001


Thanks Ralf,

I tried the channel the other night, but wasn't to
successful at getting any help that night.

Here is the problem. I create a kde-normal app using
Kdevelop. I add one Toolbar doing the following to the
xml .rc file:

<ToolBar name="dialogsToolBar" fullwith="false"
newline="true" ><text>Dialogs Tool Bar</text>
  <Action name="objectdlg" group="dlgs"/>
</ToolBar>

I then add a KToggleAction object in the initActions
section of the app object with an accelerator key
"CTRL+Key_T", as follows:

kta = new KToggleAction( i18n("Objects Dialog") ,
QIconSet(QPixmap("pixmaps/objectdlg.xpm")), CTRL+Key_T
, this, SLOT(slotObjToolShowHide()),
actionCollection(),"objectdlg");

I see the toolbar with the button and the mouse works
with it however I can't acces it with the accelerator
key.

I looked at the KCalc app, because it used accelerator
keys and i wanted to understand what i was doing
wrong. I noticed it used the QAccel object. So i used
it too, as follows:

QAccel* ptrAccel = new QAccel( this );
ptrAccel->connectItem(
ptrAccel->insertItem(Key_T+CTRL),this,SLOT(slotObjToolShowHide())
);

And this works!

Should I be doing something extra with KToggleAction?
I don't think I should be using QAccel. I thought
KToggleAction was suppose to hook everything up for
me. 

I have seen other methods used, such as "plug". Would
anyone know what I am NOT doing when using the
KToggleAction object. Perhaps I am leaving out a step.

Thanks.

--- Ralf Nolden <nolden at kde.org> wrote:
> On Thursday, 22. November 2001 03:19, you wrote:
> 
> Please log onto irc.kde.org with an IRC client and
> /join #kde. There's all 
> the other KDE programmers as well who'll for sure
> give you a helping hand 
> online.
> 
> Ralf
> > I have a question on using Accelerator key with my
> > app. Would anyone like to take a moment and help
> me?
> >
> > I would appreciate it. Thanks.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! GeoCities - quick and easy web site
> hosting, just $8.95/month.
> > http://geocities.yahoo.com/ps/info1
> >
> > -
> > to unsubscribe from this list send an email to
> > kdevelop-devel-request at kdevelop.org with the
> following body: unsubscribe
> > »your-email-address«
> 
> -
> to unsubscribe from this list send an email to
> kdevelop-devel-request at kdevelop.org with the
> following body:
> unsubscribe »your-email-address«

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop-devel mailing list