No subject

Thu Mar 8 10:26:06 GMT 2007

Usage Within the XML Framework:

If you are using KAction within the context of the XML menu and
toolbar building framework, then there are a few tiny changes. The
first is that ****you must insert your new action into an action
collection****. The action collection (a KActionCollection) is,
logically enough, a central collection of all of the actions
defined in your application. The XML UI framework code in KXMLGUI
classes needs access to this collection in order to build up the
GUI (****it's how the builder code knows which actions are valid and
which aren't****).

KActionList (the 'type' of the second arg of plugActionList, which
is QPtrList<KAction> in C++) works fine - it does conversions
between a Python list and the C++ type. I'd suspect from the above
that you have to use the KActionCollection arg that you have set to
None in the sample code, but I was off target in suggesting that you
replace the 'openWithActions' list - you probably want both (so the
'actions()' bug shouldn't affect you).

Try replacing 'None' with self.actionCollection () It shouldn't
make a difference in being able to plug/unplug the KActions - it's
mostly a container and it isn't real obvious from the C++ code
exactly how it's used (at least not in the short look I gave it -
looking at the kxmlguiclient.cpp code might be more informative,
esp. plugActionList).

I really appreciate that you're testing this stuff - there's
obviously a lot I haven't been able to get to, and even the testing
I'm implementing now wouldn't have caught the %ConvertToSubClass
stuff -- thanks!


More information about the PyQt mailing list