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

List:       kde-devel
Subject:    KParts::ReadOnlyPart in Java with KLibFactory: not possibile?!?
From:       Mario Scalas <mario.scalas () libero ! it>
Date:       2005-01-21 12:54:13
Message-ID: 200501211352.49619.mario.scalas () libero ! it
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


[Sorry for re-posting here but I've received no answer and hope that more 
people could help here]

I need to get a ReadOnlyPart instance (a Part will work fine fot my needs, 
too) so that I can embed its widget in my KMainWindow and merge the GUIs. The 
problem is that the currently generated binding returns a QObject instead of 
a Part (the minimum base class I need to gain access to part's widget):

KLibFactory factory = KLibLoader.self().factory( "libosgviewerpart" );

# This what I get
QObject part = factory.create( this, "osgviewer_part", 
"KParts::ReadOnlyPart" );

# This what I need:
Part part = factory.create( this, "osgviewer_part", 
"KParts::ReadOnlyPart" );

# I need the widget and I need part to be a Part, not a QObject 
QWidget widget = part.widget();

In C++ all is solved by using a static_cast<> but in Java? Also recurring to 
the Java reflection API doesn't help since what is returned by 
factory.create() is really a QObject (Java class) and not a Part (Java 
class).

The question is: it is possible to use KParts in Java by using the 
KLibFactory-pattern or I've to manually generate SMOKE bindings for my part 
and "simply instantiate" it directly as I see it is done for the KHTMLPart?

Any ideas?

Thanks
Mario

-- 
Mario Scalas

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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