[PyKDE] can not load xml ui resource file?

Jim Bublitz jbublitz at nwinternet.com
Sun Apr 20 19:32:01 BST 2003


On 20-Apr-03 Paul Pacheco wrote:
> I am trying to create a KMainWindow in PyKDE and I am having
> problems trying to create the ui from an xml rc file.
 
> I tried the example in examples3 by doing:
> cd examples3
> python xmlmenudemo.py
 
> and I see the exact same problem.
> not everything in xmlmenudemoui.rc is being displayed. in
> particular the Demo menu, the SpecialActionName action, and the
> toolbar does not contain any of the things listed in the rc
> file.
> 
> It seems only the standard actions are being shown. Am i doing
> something wrong?

Solution #1:

In  kde3/share/apps (or whatever corresponds to that on your
distribution) as *root*:

1. mkdir xmlmenudemo
2. copy the xmlmenudemoui.rc file to the new directory
------

 -OR-

Solution #2:

In line 61 of xmlmenudemo.py change:

 self.createGUI ()

to:

 self.createGUI ("/home/jim/PyKDE-3.5-1/examples3/xmlmenudemoui.rc")

Obviously, your path will be different, but I wanted to emphasize
that it apparently needs to be the complete path (just
"xmlmenudemoui.rc" or "./xmlmenudemoui.rc" won't work).

This isn't necessary if you do solution #1.
-------

This appears to be a change in KDE - I suspect it's for increased
security, as you have to provide a full path or install the .rc in
a directory that's owned by root.

To see why only the standard actions were loaded without one of the
fixes above, see the comments in xmlmenudemo.py.

Let me know if this doens't work for you. If it doesn't, the error
comes down to a single line (createGUI) and it isn't fun to debug
that, as you've probably discovered already.

Jim




More information about the PyQt mailing list