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

List:       kde-devel
Subject:    Re: KParts::ReadOnlyPart in Java with KLibFactory: not possibile?!?
From:       Anatoli Gorchetchnikov <anatoli () cns ! bu ! edu>
Date:       2005-01-21 14:13:02
Message-ID: 200501210913.02861.anatoli () cns ! bu ! edu
[Download RAW message or body]

Might be smth like

Part* part = dynamic_cast<Part*>(factory.create( this, "osgviewer_part",
"KParts::ReadOnlyPart" ));


On Friday 21 January 2005 08:52, Mario Scalas wrote:
> [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

-- 
Regards,

Anatoli
 
>> 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