Requiring KApplication because of installX11EventFilter (was Re: KModifierKeyInfo moved to kdereview)

Thiago Macieira thiago at kde.org
Tue May 5 23:15:31 BST 2009


Benjamin Meyer wrote:
>On May 5, 2009, at 1:46 PM, Aaron J. Seigo wrote:
>> On Tuesday 05 May 2009, Benjamin Meyer wrote:
>>> In the end I could run KDE4 apps on top of QApplication.
>>
>> yes, one _can_ but there are still things in KApplication that give
>> some
>> harmony across KDE apps like a consistent entry on the session bus
>> (setApplicationName, setOrganizationName), the x11 start up id stuff,
>> registration of KUrl as a metatype, checking writability of config,
>> rtl
>> awareness, some platform dependent stuff (e.g. the tray icon on a
>> mac) ...
>>
>> i'm not expecting all of these things to magically go into Qt, but
>> they do
>> make KApplication, at least for gui apps, not quite optional without
>> running
>> into either inconsistencies or a lot of code dupe.
>>
>> what it does mean, of course, is that our widgets and other
>> libraries should
>> never, ever use KApplication internally anymore as they have no need
>> to
>> (KComponentData ftw! :). only the actual executable applications
>> should ever
>> see / require this class.
>
>I want to say that I made a static function that was in KAppication
>which did many of those KDE type things you mentioned.  I want to say
>you could do something like:
>
>QApplication app;
>KApplication::init();
>
>The key was really that there didn't need to have a kApp instance (and
>thus no segfaults) which was the real goal.  A lone static function
>that happen to reside in KApplication that setup all those kde stuff
>was what it was about.

And we can do this in a load-time function too, so calling the function is 
unnecessary.

Would solve the problem of Qt Designer spewing errors about KUrl not being 
registered.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090506/b9513766/attachment.sig>


More information about the kde-core-devel mailing list