Hi,
This is also what I discovered later. It seems a bit weird to me, as I
think it would be more logical to provide a signal when the user right
clicks on the icon (as it's a fairly common action - who middle-clicks on a
tray icon, ever, ...?), but well, this is the way it works.

Anyway, I finally found a way to do what I wanted by connecting to the
"aboutToShow" signal of the QMenu returned by contextMenu() call of the
KStatusNotifierItem's associated "KMenu" object: by doing so, I can update
the menu safely right before it's displayed.

As a sidenote, trying the same thing directly over KStatusNotifierItem's
KMenu object didn't work, and leaded to strange dbus-related errors
appearing on the console...

Kind regards,
  Eduard Huguet










2013/6/25 Albert Astals Cid <aa...@kde.org>

> El Dimarts, 25 de juny de 2013, a les 10:42:42, Eduard Huguet va escriure:
> > Hi,
> > I'm trying to add tray icon support for a small application of my own,
> and
> > I'd like to be able to regenerate the context menu right before this is
> > displayed.
> >
> > To do so, I try to connect KStatusNotifierItem's
> > "secondaryActivateRequested" signal to an slot in my dialog, assuming
> that
> > it would get emitted when right-clicking on the tray icon (according to
> > doc), but apparently it never gets fired. ¿Is this really implemented, or
> > I'm simply misunderstanding the purpose of this signal?
>
> Reading the code it seems to me it's middle-clicking thaat fires it and not
> right-clicking.
>
> Cheers,
>   Albert
>
> >
> > Anyway, if anyone have any other idea about how I could implement this
> > (updating context menu contents right before it gets displayed), I'd be
> > glad to know it :-)
> >
> > Kind regards,
> >   Eduard Huguet
>
>
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to