[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] KPart problem
From:       David Boddie <david () boddie ! org ! uk>
Date:       2005-07-24 21:17:35
Message-ID: 200507242317.35467.david () boddie ! org ! uk
[Download RAW message or body]

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.

Hope this helps,

David

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic