[PyKDE] Partial part-problem

Daniel Marcel Eichler shirow at gmx.net
Fri Apr 14 13:20:15 BST 2006


Hi

I have some stupid problems with some kparts. Loading of the parts is no 
problem, but i can't open a file wih them. KPDF an Kate-Kpart goes well, 
but with others like libkghostviewpart not. So, anybody can give me a 
hint?

Oh yeah, here my minimal test-code:

#######################################
#! /usr/bin/env python
# -*- coding: utf8 -*-

from kdecore import KApplication, KShortcut, KURL
from kdeui import KAction
from kfile import KFileDialog
from kparts import createReadOnlyPart, KParts

from sys import argv, exit

libs = ('libkghostviewpart', 'libgvimagepart', 'khtmlimagepart', 
'libkatepart', 'libkpdfpart')

app = KApplication(argv, '')
window = KParts.MainWindow()
part = createReadOnlyPart(  libs[0], 
                            window, 
                            'KPart',
                            'KParts::ReadOnlyPart')
window.setCentralWidget(part.widget())
window.show()

part.openURL(KFileDialog.getOpenURL())
    
exit(app.exec_loop())
#######################################

mfg

Daniel




More information about the PyQt mailing list