[RFC] Using KPassivePopup from KSystrayIcon

Alessandro Praduroux pradu at pradu.it
Thu Mar 29 15:59:46 BST 2007


Il Thursday 29 March 2007 16:17:19 hai scritto:
> On Thursday 29 March 2007, Alessandro Praduroux wrote:
> > Since QSystemTrayIcon does not derive from QWidget, it is not possible to
> > call the static ::message methods of KPassivePopup from a tray icon
> > handler and have the passive popup displayed near the tray area.
> >
> > since Qt 4.3 introduced the geometry() method to QSystemTrayIcon, it is
> > now possible to correctly place the KPassivePopup.
> >
> > I implemented the needed new static methods in KPassivePopup accepting a
> > QSystemTrayIcon * instead of a QWidget.
> >
> > Patch attached, AFAICT doesn't even break BC, is it ok to commit?
>
> It breaks SC though:
>
> /d/kde/src/4/koffice/kspread/CellStorage.cpp:320: error: call of overloaded
> ‘message(QString, int)’ is ambiguous
> /d/kde/inst/kde4/include/kpassivepopup.h:207: note: candidates are: static
> KPassivePopup* KPassivePopup::message(const QString&, QWidget*)
> /d/kde/inst/kde4/include/kpassivepopup.h:215: note:                 static
> KPassivePopup* KPassivePopup::message(const QString&, QSystemTrayIcon*)
>
> Not that breaking SC isn't allowed currently [on mondays], but it makes me
> wonder if the API could be improved to avoid the ambiguity when passing
> 0... (QWidget*)0 works but is always a bit ugly...

the only clearly elegant solution is probably what Lubos proposed, that is 
remove KPassivePopup from kdeui and move it to knotify, but that involves 
migrating all the code that is using KPassivePopup. That's quite a bit of 
code: http://lxr.kde.org/ident?i=KPassivePopup.

And it needs to be done before monday, right?







-- 
http://www.pradu.it/
pradu at pradu.it




More information about the kde-core-devel mailing list