[Interest] Qml Javascript pragma libray use Qt.matrix4x4() possible?

Jérôme Godbout jerome at bodycad.com
Wed Nov 2 18:32:19 CET 2016


Hi Sina,

your right, this work into recent Qt version (into 5.5.1 at least), my bad,
just realize the code was using a context singleton fonction instead of the
Qt call to create the object. some coder here seem to find Qt.vector3d() to
long to type so they made vec3() function that create a vector3d and this
doesn't work since the singleton is not into the context. I'm hunting those
thing down and removing them, for this kind of reason.

Sorry about this, code 13, really need to finish killing this old vec3(),
vec2() fonctions down they are only a pain.
Jerome

On Wed, Nov 2, 2016 at 12:46 PM, Cavit Sina Dogru <sinadooru at gmail.com>
wrote:

> Hey Jerome,
>
> Seems like my JS environment recognize the Qt global object by default,
> without importing any. Even on stateless js library file (.pragma library).
>
> I am using Qt 5.7 here. Are you sure if you can not access the Qt global
> object just because you are on stateless js library file?
>
> Cheers,
> Sina
>
> On Fri, Oct 28, 2016 at 4:28 PM, Jérôme Godbout <jerome at bodycad.com>
> wrote:
>
>> Hi,
>>
>> I have a javascript script that doesn't have any hard requirement and
>> widely used  inside our code, therefor I would like it to be .pragma
>> library to avoid multiple instance. I have a function that need to create a
>> Qt.matrix4x4() and return the value, but since it's a pragma library script
>> I cannot access the Qt singleton/object.
>>
>> Is there any way to import it into the pragma or I have to make that
>> function non pragma library as soon as I want to return a Qt basic type
>> (matrix4x4, vector3d...)?
>>
>> Clearly Qt.include() cannot be used, but maybe import but I don't know
>> what the resource url/version could be?
>>
>> .import TypeNamespace MajorVersion.MinorVersion as Qualifier
>>
>> or something similar? or is that also prevented into pragma library?
>>
>> Thanks,
>> Jerome
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161102/fc6cc18d/attachment.html>


More information about the Interest mailing list