[PyKDE] KPart problem

Roberto Alsina ralsina at kde.org
Mon Jul 25 00:46:57 BST 2005


> On Sun Jul 24 21:28:38 MEST 2005, Roberto Alsina wrote:
>
>> And here's my attempt:
>>
>> def main(args):
>>         app=kdecore.KApplication(args,'dropbear')
>>         win=kparts.KParts.MainWindow()
>>         app.setMainWidget(win)
>>         factory = kdecore.KLibLoader.self().factory( "libkonsolepart" );
>>         win.setCentralWidget(p.widget())
>>         win.show()
>>         app.exec_loop()
>>
>> I'm getting that p has no widget member.
>>
>> Any ideas?
>
> It looks like the QObject returned from factory.create(win) isn't getting
> converted to the proper subclass. Although it may be possible to implement
> the correct behaviour in PyKDE, there is an alternative approach: simply
> replace the lines
>
>   factory = kdecore.KLibLoader.self().factory( "libkonsolepart" );
>   p=factory.create( win)
>
> with
>
>   p = kparts.createReadWritePart("libkonsolepart", win, "konsole",
>                                  "KParts::Part")
>
> The syntax for this convenience function is
>
>   createReadWritePart(lib, parent, name, className, args)
>
> and I think I've chosen the correct library and class names for your
> example.
>


Great, thanks! I will try it.

-- 
 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  ralsina at kde.org
 (_Y_.)' ._   ) `._`.  " -.-'   KDE Developer (MFCH)
  _..`-'_..-_/ /-'_.'
(l)-'' ((i).' ((!.'             Buenos Aires - Argentina
Imminentizing the eschaton since 1971.




More information about the PyQt mailing list