Main problem with this is that Java doesn’t have that much of templates 
support, so one would need to quite completely rewrite those methods, by hand, 
most likely. And I have absolutely no idea whether / how it’d work in code side.

So uh, you need to provide us use case so that we can look into it if there is 
any other way to implement this.

On Wednesday 08 December 2010 00:12:41 Helge Fredriksen wrote:
> Hello again!
> 
> I'm not sure that what you are trying to achieve is even possible in
> QtJambi. I guess you are referring to the example found at
> 
> http://doc.qt.nokia.com/qtjambi-4.5.2_01/com/trolltech/qt/script-context2d.html
> 
> where the CanvasGradient is mentioned the way you are writing. However,
> there's probably a reason why all the code is in C++.
> 
> However, I haven't seen any usage of this in QtJambi, and I'm not enough
> expert to tell you how this can be done.
> 
> Regards,
> Helge Fredriksen
> 
> On Tue, Dec 7, 2010 at 3:13 PM, Zhongmiao Li <[email protected]> wrote:
> 
> > I‘m now reimplementing context2D of Qt into QtJambi ( if you can tell me
> > some easier options, it will best).
> > Just as the two line describes, CanvasGradient  is my custom class, and
> > style is a variable of QVariant.
> > So I just want to first see whether style can be converted to  
> > CanvasGradient
> > , if it's possible then do the conversion. But a problem is that I just
> > can not the global functions qVariantCanConvert and qvariant_cast<> in
> > QtJambi...
> > Thank you!
> >
> >
> >
> >
> > On Tue, Dec 7, 2010 at 5:01 AM, Helge Fredriksen 
> > <[email protected]>wrote:
> >
> >> Hello Zhongmiao.
> >>
> >> Please elaborate a bit. What are you trying to achieve?
> >>
> >> Regards,
> >> Helge Fredriksen
> >>
> >> On Tue, Dec 7, 2010 at 10:21 AM, Zhongmiao Li <[email protected]>wrote:
> >>
> >>> Hi everyone,
> >>>
> >>> I can not figure how to use  QVariant in QtJambi.
> >>> So can you tell me how to write the following code in QtJambi?
> >>>
> >>> if (qVariantCanConvert<CanvasGradient>(style)) {
> >>>          CanvasGradient cg = qvariant_cast<CanvasGradient>(style);
> >>>
> >>> Thanks very much!!
> >>>
> >>>
> >>> --
> >>> Best regards
> >>> Li Zhongmiao
> >>> Digital Media, College of Computer Science, Zhejiang University
> >>>
> >>>
> >>> _______________________________________________
> >>> Qt-jambi-interest mailing list
> >>> [email protected]
> >>> http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
> >>>
> >>>
> >>
> >
> >
> > --
> > Best regards
> > Li Zhongmiao
> > Digital Media, College of Computer Science, Zhejiang University
> >
> >
> 

-- 
Terveisin,
Samu Voutilainen
http://smar.fi

_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to