[PyKDE] KPart crashs

Jim Bublitz jbublitz at nwinternet.com
Mon Sep 25 04:45:01 BST 2006


On Sunday 24 September 2006 14:34, Daniel Marcel Eichler wrote:
> Jim Bublitz wrote:
> >The following program imports a KPart - KPDF, KGhostview or KWord. Any
> > of these work fine for me. KPDF and KGhostView will read and display a
> > PDF file. KWord will open and allow you to edit a plain text file.
>
> Like in the past, the kpart is loaded. But the problems still exists.
>
> KGhostview doesn't load anything. Need a screenshot for further
> understanding?

> KWord allow editing of the text, but crashs if i wanna open the
> contextmenu.

With the shortI don't get any context menu for KWord (I get some ASSERTs on 
the console, but no crash) - may need more of the interface loaded. The popup 
menus work for kghostview and kpdf, and for kpdf, the pager at the bottom of 
the sidebar works as does the search box at the top.

Your script below from our original exchange also works fine. I get the entire 
GUI (since you included the createGUI call, and it's probably picking up 
KWord's .rc file), but I still get the same result for context menus - 
ASSERTs, but no crash.

from kdecore import *
from kdeui import *
from kfile import *
from kparts import *
from sys import argv, exit

app = KApplication(argv, '')
window = KParts.MainWindow()
part = createReadWritePart('libkwordpart', window, 'KPart', 
'KParts::ReadWritePart')
part.setReadWrite(True)
window.createGUI(part)

window.setCentralWidget(part.widget())
window.show()
part.openURL(KFileDialog.getOpenURL())
exit(app.exec_loop())


> Oh, good news, the contextmenu in kpdf is now working. I thing, this is
> because of a distribution-update. So the mainproblem ist the koffice-part
> and kghostview.
>
> >I'm not sure what was causing your crash, but these all work fine - I
> > haven't made any modifications to PyKDE in this area (in fact I was
> > just going to start digging into it, but apparently what I need is some
> > good example programs). None of these have any of the menu interface
> > stuff implemented.
>
> Possible that it's a distribution-problem? I use Kubuntu 6.06. IIRC were
> there some other kubuntu-user some months ago, with similar problems :-?
>
> >I'm very sorry for the slow response (and in reading back, a pretty poor
> >response on my part). I've had very little time to look at any of this
> > the last few months.
>
> Well, it's ok. I freezed my pykde-project, since the kpart doesn't work.
> Meanwhile, i restructure the whole target of my idea a little bit, so i
> have time to wait ;)

Can you give me info on the sip, PyQt, PyKDE and KDE versions? None of those 
should really make much difference in this case, but it might help to know. 
I'm running it on PyKDE 3.16.0 or 3.16.1 (coming out in a few days)  with 
PyQt 3.16, sip 4.4.1 and KDE3.4.3 and KDE 3.5.3. Nothing in PyKDE has changed 
wrt to this in several years.

If there's another kubuntu user reading the thread, it would be helpful if 
they could run either my script from the previous post or the one in this 
post. I'll post another msg to solicit more feedback.

It's going to be hard for me to troubleshoot, as I can't duplicate the 
failure. I'll try to get the KWord context menu working as well, and work up 
some other example code. At the moment it looks like some difference in 
either kubuntu or the way your system is set up, but I'd like to see this 
stuff work for any distribution/user.

Jim





More information about the PyQt mailing list