[PyKDE] KTrader woes?

Paul Evans pevans at catholic.org
Fri Oct 31 18:57:00 GMT 2003


Sundance sundance_at_ierne.eu.org:
>Well, more precisely, it works if I copy the KCmdLineArgs.init line from 
>mimetype.py. If I call KApplication([], "SomeName") it dies. Apparently 
>KApplication REQUIRES a non-empty list as its first argument, unlike 
>QApplication (with which the [] trick works).

Jim,
sorry if this has been fixed in newer versions than the 3.7-3 version - I 
haven't been able to follow some of the discussion on the topic (c++).

I recently had to change one program from QApplication to KApplication to 
support a kde widget and found that not only does it require a non-empty list 
as Sundance noted, but there can only be One element in that list or it will 
fail on 'Unexpected argument '. Of course, the program still works fine when 
its main class is instantiated from another script with args.

I got around it by passing [sys.argv[0]] to KApplication when run stand-alone. 
This way it starts fine and the main class can pick off the args it needs. 
However, the kde crash handler kicks in when the program exits now.

Sorry if this is fixed, I can certainly handle it for the time being until I 
upgrade. If not, can you suggest a proper cure over my work around?

-- 
Regards, Paul Evans





More information about the PyQt mailing list