Re: [Interest] Packaging a Qt App for Linux/MacOSX/Windows

2016-06-17 Thread Ch'Gans
On 18 June 2016 at 17:30, Scapegoat Sarthak  wrote:
> I am curious - if you have your project configured in c++/cmake style, you
> can (and probably should) use CPack. Lots of documentation available online.

Hi Scapegoat,

Thanks for the link. I'm not using CMake, but CPack seems usable without CMake.
Anyway, I would prefer a solution based on Qt IFW and Qbs.

Thanks,
Chris


>
> On 18 June 2016 at 01:17, Ch'Gans  wrote:
>>
>> On 18 June 2016 at 00:19, Ch'Gans  wrote:
>> > Hi there,
>> >
>> > I've recently added a (very basic) offline installer to my project
>> > using the Qt installer framework and i'm looking for a multi platform
>> > solution to detect my app dependencies and to ship (some of) them into
>> > my installer.
>> > Ideally I would like to automate this...
>> >
>> > The following pages gives lot of hints and advices:
>> > http://doc.qt.io/qt-5/osx-deployment.html
>> > http://doc.qt.io/qt-5/linux-deployment.html
>> > http://doc.qt.io/qt-5/windows-deployment.html
>>
>> These 3 links +
>> http://lists.qt-project.org/pipermail/qbs/2015-July/001321.html gives
>> enough information to digest. Basically, you have to do everything
>> manually, but at least it's doable and not that difficult (I now have
>> my installer working correctly for Linux, next step is Windows).
>>
>> Another source of information I found useful is the qbs scripts within
>> QtCreator itself. These, plus checking how QtCreator is installed on
>> the target OS help understand what has to be done and how it can be
>> done.
>>
>> Also, worth mentioning, Qbs JIRA Epic "Support for creating
>> redistributable installer packages":
>> https://bugreports.qt.io/browse/QBS-16
>>
>> Chris
>>
>> >
>> > Some of the tricks in there rely on qmake features, but unfortunately
>> > I'm using Qbs...
>> >
>> > Does anyone has any recommendation, tools, examples, magic scripts, or
>> > other useful stuff to point out?
>> >
>> > Thanks for sharing,
>> > Chris
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Packaging a Qt App for Linux/MacOSX/Windows

2016-06-17 Thread Scapegoat Sarthak
I am curious - if you have your project configured in c++/cmake style, you
can (and probably should) use CPack. Lots of documentation available online.

On 18 June 2016 at 01:17, Ch'Gans  wrote:

> On 18 June 2016 at 00:19, Ch'Gans  wrote:
> > Hi there,
> >
> > I've recently added a (very basic) offline installer to my project
> > using the Qt installer framework and i'm looking for a multi platform
> > solution to detect my app dependencies and to ship (some of) them into
> > my installer.
> > Ideally I would like to automate this...
> >
> > The following pages gives lot of hints and advices:
> > http://doc.qt.io/qt-5/osx-deployment.html
> > http://doc.qt.io/qt-5/linux-deployment.html
> > http://doc.qt.io/qt-5/windows-deployment.html
>
> These 3 links +
> http://lists.qt-project.org/pipermail/qbs/2015-July/001321.html gives
> enough information to digest. Basically, you have to do everything
> manually, but at least it's doable and not that difficult (I now have
> my installer working correctly for Linux, next step is Windows).
>
> Another source of information I found useful is the qbs scripts within
> QtCreator itself. These, plus checking how QtCreator is installed on
> the target OS help understand what has to be done and how it can be
> done.
>
> Also, worth mentioning, Qbs JIRA Epic "Support for creating
> redistributable installer packages":
> https://bugreports.qt.io/browse/QBS-16
>
> Chris
>
> >
> > Some of the tricks in there rely on qmake features, but unfortunately
> > I'm using Qbs...
> >
> > Does anyone has any recommendation, tools, examples, magic scripts, or
> > other useful stuff to point out?
> >
> > Thanks for sharing,
> > Chris
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Packaging a Qt App for Linux/MacOSX/Windows

2016-06-17 Thread Ch'Gans
On 18 June 2016 at 00:19, Ch'Gans  wrote:
> Hi there,
>
> I've recently added a (very basic) offline installer to my project
> using the Qt installer framework and i'm looking for a multi platform
> solution to detect my app dependencies and to ship (some of) them into
> my installer.
> Ideally I would like to automate this...
>
> The following pages gives lot of hints and advices:
> http://doc.qt.io/qt-5/osx-deployment.html
> http://doc.qt.io/qt-5/linux-deployment.html
> http://doc.qt.io/qt-5/windows-deployment.html

These 3 links +
http://lists.qt-project.org/pipermail/qbs/2015-July/001321.html gives
enough information to digest. Basically, you have to do everything
manually, but at least it's doable and not that difficult (I now have
my installer working correctly for Linux, next step is Windows).

Another source of information I found useful is the qbs scripts within
QtCreator itself. These, plus checking how QtCreator is installed on
the target OS help understand what has to be done and how it can be
done.

Also, worth mentioning, Qbs JIRA Epic "Support for creating
redistributable installer packages":
https://bugreports.qt.io/browse/QBS-16

Chris

>
> Some of the tricks in there rely on qmake features, but unfortunately
> I'm using Qbs...
>
> Does anyone has any recommendation, tools, examples, magic scripts, or
> other useful stuff to point out?
>
> Thanks for sharing,
> Chris
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] linux 64 5.7.0 WebEngine segfault

2016-06-17 Thread Kevin Mcintyre
Follow-up - segfault was the result of trying to use
QWebEngineUrlRequestInterceptor - a class I haven't been able to get
working.

On Fri, Jun 17, 2016 at 9:23 AM, Kevin Mcintyre  wrote:

> When starting webengine - I get this error,
>
> [0617/091642:ERROR:browser_main_loop.cc(217)] Running without the SUID
> sandbox! See
> https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md
> for more information on developing with the sandbox on.
>
> followed by this segfault
>
> kernel: [37309.009921] Chrome_IOThread[7824]: segfault at 61 ip
> 7f65a7ae2baa sp 7f656cc18300 error 4 in
> libQt5WebEngineCore.so.5.7.0[7f65a7486000+4e16000]
>
> Any pointers as to how to resolve would be greatly appreciated.
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [qt3d] Loading textures from a custom file format

2016-06-17 Thread Xavier Bigand
I finally make it works, but I am not sure to do everything correctly.

Firslty I change the way to attach the Texture to the QDiffuseMapMaterial :

QDiffuseMapMaterial*material = new QDiffuseMapMaterial();
Texture*diffuseTexture = new Texture();
  // Instancing our custom Texture class to be able to load our
file format instead of retrieving the QAbstractTexture of material

diffuseTexture->setSource(texturePath);
 // Calling our custom file loader

material->setDiffuse(diffuseTexture);



The setSource method load and fill a Qt3DRender::QTextureImageDataPtr that
is directly given at the added TextureImage.

I don't know if it's the right thing to do everything in my implementation
of QAbstractTexture.


I am also curious on how set the anisotropy level.




2016-06-17 16:21 GMT+02:00 Xavier Bigand :

> I am trying to understand how I have to use QAbstractTexture and
> QAbstractTextureImage to load textures from our custom format.
>
> Our format is pretty simple and consist in a compressed file that contains
> an header with all necessary informations :
>  - texture size
>  - precise texture format (PVRTCI_4bpp_RGBA, ETC1,...)
>  - number of mipmaps
>
> And it's naturally followed by the pixels buffer.
>
> If I understand correctly how it works the best way to manage it is to
> create a Texture class that will load the file and instantiate TextureImage
> corresponding to the number of mipmaps level I have.
>
> Am I right?
>
> --
> Xavier
>



-- 
Xavier
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Xavier Bigand
I share your concern about using private APIs but there is no other
solution at the moment.

And if it can reassure you, we are using those APIs since two year on an
application in production without any issue.

I think that those API wasn't pushed public since Qt5 because it have a
better support of all platforms out of the box than Qt4, but for some heavy
applications likes Home Design 3D it still import to be able to customize
our development pipeline.




2016-06-17 21:28 GMT+02:00 Max Savenkov :

> Thank you, I knew about this method, but I, as I wrote originally, I want
> to avoid the use of the private APIs if possible. I might vote for that
> bug, though - reasoning behind "privatizing" FileEngine seems a bit shaky
> to me.
>
> 17.06.2016 21:32, Xavier Bigand пишет:
>
> I think that we do something similar that you try to achieve.
>
> I am working on an application that almost works like a game. During
> development our resources on the regular file system of Windows, Mac,...
> but when building the final release all ressources are filtered and
> compressed in a custom package file format to optimize resources for each
> platforms,
>
> So by using regular file system during the development, there is no issue
> with Qt tools including QtCreator and QML editor.
>
> The only little issue we have actually is that we need to extract all qml
> files from the package before loading our main.qml to the file system of
> the current device when we execute the final release.
> Else qml can access every resources from the package.
>
> To make Qt and Qml able to load resources from the package you need to
> implement a QAbstractFileEngine and QAbstractFileEngineHandler.
>
> The Engine handler contains only "create(const QString& fileName)" method
> that have to instanciate our derived class of QAbstractFileEngine if the
> fileName is in our package, else return nullptr to fallback to the regular
> file system
>
> We simply prefix all our resources path by "/PACKAGE_NAME/" when setting
> source properties in QML. To be precise in QML we call a c++ method that
> transform the relative path given in parameter to the full form, this is
> this method that prefix the path to force QML to read files from the
> package or not.
>
> I also didn't recommend you to use qrc files as it doesn't allow you to
> make your application able to reload QML,... when running. We do hot
> reloading because QML editor doesn't work if you bind C++ methods.
>
>
> PS:
> This method isn't officially supported by Qt as QAbstractFileEngine
> and QAbstractFileEngineHandler are privates.
> You will have to use includes like that :
>
> #if QT_VERSION == 0x050402
>
> #   include 
>
> #elif QT_VERSION == 0x050500
>
> #   include 
>
> #elif QT_VERSION == 0x050501
>
> #   include 
>
> #elif QT_VERSION == 0x050600
>
> #   include 
>
> #elif QT_VERSION == 0x050601
>
> #   include 
>
> #elif QT_VERSION == 0x050700
>
> #   include 
>
> #else
>
> #   error
>
> #endif
>
>
>
> Feel free to vote for the come back of those APIs :
>
> https://bugreports.qt.io/browse/QTBUG-41387?jql=text%20~%20%22QAbstractFileEngineHandler%22
> 
>
>
>
>
> 2016-06-17 18:47 GMT+02:00 Jason H :
>
>> You can of course use all of Qt without QtCreator. I've done it, and it's
>> still possible.
>>
>> When you have a resource, it becomes availible in the binary's asset
>> system, and need not be distributed as a file on disk. This can prevent
>> tampering if the binary is signed. Also I would assume that it gets loaded
>> in the text segment of the executable and winds up on memory pages without
>> the EXEC bit set.
>>
>> http://doc.qt.io/qt-5/resources.html
>>
>>
>> *Sent:* Friday, June 17, 2016 at 12:37 PM
>> *From:* "Max Savenkov" < max.saven...@gmail.com>
>> *To:* "Jason H" < jh...@gmx.com>
>> *Cc:* "Dmitry Volosnykh" < 
>> dmitry.volosn...@gmail.com>, "" <
>> interest@qt-project.org>
>>
>> *Subject:* Re: [Interest] Routing all QML file requests through a custom
>> resource provider
>> OK, but if I do not use QtCreator, is there no way to make it work? What
>> does adding a qrc file to RESOURCES actually do (besides triggering
>> resource compiler)? I'm looking for an understanding here.
>>
>> 2016-06-17 19:23 GMT+03:00 Jason H < jh...@gmx.com>:
>>
>>>
>>>
>>> What Dimitry said plus:
>>>
>>> Add:
>>> CONFIG += resources_big
>>>
>>>
>>> to your .pro file, which should get around some long linking times.
>>>
>>>
>>> --
>>> Sent: Friday, June 17, 2016 at 5:45 AM
>>> From: "Dmitry Volosnykh" < 
>>> dmitry.volosn...@gmail.com>
>>> To: "Max Savenkov" < 
>>> max.saven...@gmail.com>, "" <
>>> interest@qt-project.org>
>>> Subject: Re: [Interest] Routing all QML file requests through a custom
>>> resource provider
>>>
>>> Hi, Max!
>>>
>>> To be honest, I did not understa

Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Max Savenkov
Thank you, I knew about this method, but I, as I wrote originally, I 
want to avoid the use of the private APIs if possible. I might vote for 
that bug, though - reasoning behind "privatizing" FileEngine seems a bit 
shaky to me.



17.06.2016 21:32, Xavier Bigand пишет:

I think that we do something similar that you try to achieve.

I am working on an application that almost works like a game. During 
development our resources on the regular file system of Windows, 
Mac,... but when building the final release all ressources are 
filtered and compressed in a custom package file format to optimize 
resources for each platforms,


So by using regular file system during the development, there is no 
issue with Qt tools including QtCreator and QML editor.


The only little issue we have actually is that we need to extract all 
qml files from the package before loading our main.qml to the file 
system of the current device when we execute the final release.

Else qml can access every resources from the package.

To make Qt and Qml able to load resources from the package you need to 
implement a QAbstractFileEngine and QAbstractFileEngineHandler.


The Engine handler contains only "create(const QString& 
fileName)" method that have to instanciate our derived class of 
QAbstractFileEngine if the fileName is in our package, else return 
nullptr to fallback to the regular file system


We simply prefix all our resources path by "/PACKAGE_NAME/" when 
setting source properties in QML. To be precise in QML we call a c++ 
method that transform the relative path given in parameter to the full 
form, this is this method that prefix the path to force QML to read 
files from the package or not.


I also didn't recommend you to use qrc files as it doesn't allow you 
to make your application able to reload QML,... when running. We do 
hot reloading because QML editor doesn't work if you bind C++ methods.



PS:
This method isn't officially supported by Qt as QAbstractFileEngine 
and QAbstractFileEngineHandler are privates.

You will have to use includes like that :
#ifQT_VERSION == 0x050402
#include
#elifQT_VERSION == 0x050500
#include
#elifQT_VERSION == 0x050501
#include
#elifQT_VERSION == 0x050600
#include
#elifQT_VERSION == 0x050601
#include
#elifQT_VERSION == 0x050700
#include
#else
#error
#endif


Feel free to vote for the come back of those APIs :
https://bugreports.qt.io/browse/QTBUG-41387?jql=text%20~%20%22QAbstractFileEngineHandler%22 






2016-06-17 18:47 GMT+02:00 Jason H mailto:jh...@gmx.com>>:

You can of course use all of Qt without QtCreator. I've done it,
and it's still possible.
When you have a resource, it becomes availible in the binary's
asset system, and need not be distributed as a file on disk. This
can prevent tampering if the binary is signed. Also I would assume
that it gets loaded in the text segment of the executable and
winds up on memory pages without the EXEC bit set.
http://doc.qt.io/qt-5/resources.html
*Sent:* Friday, June 17, 2016 at 12:37 PM
*From:* "Max Savenkov" mailto:max.saven...@gmail.com>>
*To:* "Jason H" mailto:jh...@gmx.com>>
*Cc:* "Dmitry Volosnykh" mailto:dmitry.volosn...@gmail.com>>, "mailto:interest@qt-project.org>>" mailto:interest@qt-project.org>>

*Subject:* Re: [Interest] Routing all QML file requests through a
custom resource provider
OK, but if I do not use QtCreator, is there no way to make it
work? What does adding a qrc file to RESOURCES actually do
(besides triggering resource compiler)? I'm looking for an
understanding here.
2016-06-17 19:23 GMT+03:00 Jason H http://jh...@gmx.com>>:


What Dimitry said plus:

Add:
CONFIG += resources_big


to your .pro file, which should get around some long linking
times.


--
Sent: Friday, June 17, 2016 at 5:45 AM
From: "Dmitry Volosnykh" http://dmitry.volosn...@gmail.com>>
To: "Max Savenkov" http://max.saven...@gmail.com>>, "http://interest@qt-project.org>>" http://interest@qt-project.org>>
Subject: Re: [Interest] Routing all QML file requests through
a custom resource provider

Hi, Max!

To be honest, I did not understand in all the details what you
are trying to achieve. Anyway that looks way complex indeed.

Since you are inclined to pack all you resources into
auxiliary file like zip package, you are surely okay with
static content. Having this said, you should be fine using
conventional .qrc files (this is what you named Qt resource
system). These files are easily accessed (i.e. viewed, edited,
etc.) from Qt Creator. Qt Designer tools understand them
perfectly fine, as well. Also, there should be no issues when
importing QML components from you

Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Xavier Bigand
I think that we do something similar that you try to achieve.

I am working on an application that almost works like a game. During
development our resources on the regular file system of Windows, Mac,...
but when building the final release all ressources are filtered and
compressed in a custom package file format to optimize resources for each
platforms,

So by using regular file system during the development, there is no issue
with Qt tools including QtCreator and QML editor.

The only little issue we have actually is that we need to extract all qml
files from the package before loading our main.qml to the file system of
the current device when we execute the final release.
Else qml can access every resources from the package.

To make Qt and Qml able to load resources from the package you need to
implement a QAbstractFileEngine and QAbstractFileEngineHandler.

The Engine handler contains only "create(const QString& fileName)" method
that have to instanciate our derived class of QAbstractFileEngine if the
fileName is in our package, else return nullptr to fallback to the regular
file system

We simply prefix all our resources path by "/PACKAGE_NAME/" when setting
source properties in QML. To be precise in QML we call a c++ method that
transform the relative path given in parameter to the full form, this is
this method that prefix the path to force QML to read files from the
package or not.

I also didn't recommend you to use qrc files as it doesn't allow you to
make your application able to reload QML,... when running. We do hot
reloading because QML editor doesn't work if you bind C++ methods.


PS:
This method isn't officially supported by Qt as QAbstractFileEngine
and QAbstractFileEngineHandler are privates.
You will have to use includes like that :

#if QT_VERSION == 0x050402

#   include 

#elif QT_VERSION == 0x050500

#   include 

#elif QT_VERSION == 0x050501

#   include 

#elif QT_VERSION == 0x050600

#   include 

#elif QT_VERSION == 0x050601

#   include 

#elif QT_VERSION == 0x050700

#   include 

#else

#   error

#endif



Feel free to vote for the come back of those APIs :
https://bugreports.qt.io/browse/QTBUG-41387?jql=text%20~%20%22QAbstractFileEngineHandler%22




2016-06-17 18:47 GMT+02:00 Jason H :

> You can of course use all of Qt without QtCreator. I've done it, and it's
> still possible.
>
> When you have a resource, it becomes availible in the binary's asset
> system, and need not be distributed as a file on disk. This can prevent
> tampering if the binary is signed. Also I would assume that it gets loaded
> in the text segment of the executable and winds up on memory pages without
> the EXEC bit set.
>
> http://doc.qt.io/qt-5/resources.html
>
>
> *Sent:* Friday, June 17, 2016 at 12:37 PM
> *From:* "Max Savenkov" 
> *To:* "Jason H" 
> *Cc:* "Dmitry Volosnykh" , "<
> interest@qt-project.org>" 
>
> *Subject:* Re: [Interest] Routing all QML file requests through a custom
> resource provider
> OK, but if I do not use QtCreator, is there no way to make it work? What
> does adding a qrc file to RESOURCES actually do (besides triggering
> resource compiler)? I'm looking for an understanding here.
>
> 2016-06-17 19:23 GMT+03:00 Jason H :
>>
>>
>> What Dimitry said plus:
>>
>> Add:
>> CONFIG += resources_big
>>
>>
>> to your .pro file, which should get around some long linking times.
>>
>>
>> --
>> Sent: Friday, June 17, 2016 at 5:45 AM
>> From: "Dmitry Volosnykh" 
>> To: "Max Savenkov" , ""
>> 
>> Subject: Re: [Interest] Routing all QML file requests through a custom
>> resource provider
>>
>> Hi, Max!
>>
>> To be honest, I did not understand in all the details what you are trying
>> to achieve. Anyway that looks way complex indeed.
>>
>> Since you are inclined to pack all you resources into auxiliary file like
>> zip package, you are surely okay with static content. Having this said, you
>> should be fine using conventional .qrc files (this is what you named Qt
>> resource system). These files are easily accessed (i.e. viewed, edited,
>> etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
>> well. Also, there should be no issues when importing QML components from
>> your .qml files once you feed QML engine with root .qml file stored inside
>> .qrc file.
>>
>> Regards,
>> Dmitry.
>>
>> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
>> wrote:Hello,
>>
>> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
>> development. The game is going to store all its resources in a package
>> (it might be zip, or a custom format) when deployed, but during
>> development, resources are available in the usual filesystem. This
>> difference is hidden by game's resource provider, which maps resource
>> name to a file or an entry in package.
>>
>> This works for the game itself, but how can I make QML load images,
>> imports and other resources from game's resource provider? (also, I'd
>> like to view my QML files in Design

Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Max Savenkov
Thank you, I've read that link already quite a few times. What I'd like to
know, is how to use "External Binary Resources" if said external resources
are not located on disk, but in memory. However, after a bit of thinking I
decided that it's wouldn't be useful even if it is possible, as I would
have to load the whole resource into application's memory, which is not
acceptable on mobile devices.

Now I see that my options are strictly limited to either keep trying to
implement a VFS in Qt via hacks and crutches, or using separate resource
packages for the game and UI (my own format for game, and qrc/rcc for UI).

2016-06-17 19:47 GMT+03:00 Jason H :

> You can of course use all of Qt without QtCreator. I've done it, and it's
> still possible.
>
> When you have a resource, it becomes availible in the binary's asset
> system, and need not be distributed as a file on disk. This can prevent
> tampering if the binary is signed. Also I would assume that it gets loaded
> in the text segment of the executable and winds up on memory pages without
> the EXEC bit set.
>
> http://doc.qt.io/qt-5/resources.html
>
>
> *Sent:* Friday, June 17, 2016 at 12:37 PM
> *From:* "Max Savenkov" 
> *To:* "Jason H" 
> *Cc:* "Dmitry Volosnykh" , "<
> interest@qt-project.org>" 
>
> *Subject:* Re: [Interest] Routing all QML file requests through a custom
> resource provider
> OK, but if I do not use QtCreator, is there no way to make it work? What
> does adding a qrc file to RESOURCES actually do (besides triggering
> resource compiler)? I'm looking for an understanding here.
>
> 2016-06-17 19:23 GMT+03:00 Jason H :
>>
>>
>> What Dimitry said plus:
>>
>> Add:
>> CONFIG += resources_big
>>
>>
>> to your .pro file, which should get around some long linking times.
>>
>>
>> --
>> Sent: Friday, June 17, 2016 at 5:45 AM
>> From: "Dmitry Volosnykh" 
>> To: "Max Savenkov" , ""
>> 
>> Subject: Re: [Interest] Routing all QML file requests through a custom
>> resource provider
>>
>> Hi, Max!
>>
>> To be honest, I did not understand in all the details what you are trying
>> to achieve. Anyway that looks way complex indeed.
>>
>> Since you are inclined to pack all you resources into auxiliary file like
>> zip package, you are surely okay with static content. Having this said, you
>> should be fine using conventional .qrc files (this is what you named Qt
>> resource system). These files are easily accessed (i.e. viewed, edited,
>> etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
>> well. Also, there should be no issues when importing QML components from
>> your .qml files once you feed QML engine with root .qml file stored inside
>> .qrc file.
>>
>> Regards,
>> Dmitry.
>>
>> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
>> wrote:Hello,
>>
>> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
>> development. The game is going to store all its resources in a package
>> (it might be zip, or a custom format) when deployed, but during
>> development, resources are available in the usual filesystem. This
>> difference is hidden by game's resource provider, which maps resource
>> name to a file or an entry in package.
>>
>> This works for the game itself, but how can I make QML load images,
>> imports and other resources from game's resource provider? (also, I'd
>> like to view my QML files in Designer, which means I can't use custom
>> image providers in QML code itself)
>>
>> I see two possibilities, but I'm not sure of either one.
>>
>> 1) Use dynamic resources produced by rcc. When loading a QML file from
>> C++, also load relevant rcc data (from game's resources) and register it
>> with Qt resource system to make it accessible. This sounds workable, but
>> I'm not sure how exactly to make it happen. Suppose I got a binary
>> buffer from game's resources. How do I register it in Qt?
>>
>> 2) Use a system of crutches.
>> * Register Url Interceptor with my QMLEngine, such that:
>>  - any URL that contains an image is changed into
>> "image:/my_resource_provider/imagename.png"
>>  - any URL that contains qml or qmldir is change into... What? There
>> is no way to register a special loader for QML imports. But I guess I
>> can change it into a network request, by substituting shcema to, for
>> example, "my_provider"
>> * Register image provider with name "my_resource_provider" that loads
>> images from my resource system.
>> * Register a custom network access manager factory/manager/network reply
>> that load QML files from my system instead of network. This doesn't
>> quite work, however, because QML at some point for whatever reason
>> checks that URL used to load qml file is local...
>>
>> So, I'm stumped. This should be WAY easier... And it was, before
>> AbstractFileEngine was made private. But I really don't want to use
>> private APIs if I can avoid it.
>> An argument against AbstractFileEngine was made, that virtual FS should
>> be implemented "at OS level" - 

Re: [Interest] QUndoStack

2016-06-17 Thread Mike Jackson
Yes, we have already executed what constitutes the command by the time 
we push it onto the stack. Maybe we are not using QUndoStack correctly 
then? we should be creating the command that _should_ get executed, 
place it on the stack, which will then execute the command.


Still seems odd but we can look at doing that.
--
Mike Jackson  [mike.jack...@bluequartz.net]


Elvis Stansvik wrote:

2016-06-17 18:18 GMT+02:00 Mike Jackson:

We are using the QUndoStack and when we "push()" onto the stack the actual
QUndoCommand is being executed. In the documentation is seems as though I
could set the "id" of the QUndoCommand to -1 and NOT have it executed but
after looking more close at the docs and the actual source code the
QUndoCommand will definitely be executed when pushed onto the stack. This
behavior does not make sense to me and I am probably missing something
simple about how to use the QUndoStack. Could someone offer an explanation
of why my command gets executed? And also how do I get my undocommand on the
stack **without** executing the command?


I haven't used QUndoStack much myself, but to me what you describe
does not make sense. An undo stack is supposed to represent what has
happened (this history), so why should a command not be executed when
pushed? Is it that you have already executed it manually?

Either way, I think a command will always be executed when pushed, so
that's what you need to work with. The -1 id thing seems to be just
for controlling the merging behavior.

Elvis


Thanks

--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@bluequartz.net
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QUndoStack

2016-06-17 Thread Elvis Stansvik
2016-06-17 18:18 GMT+02:00 Mike Jackson :
> We are using the QUndoStack and when we "push()" onto the stack the actual
> QUndoCommand is being executed. In the documentation is seems as though I
> could set the "id" of the QUndoCommand to -1 and NOT have it executed but
> after looking more close at the docs and the actual source code the
> QUndoCommand will definitely be executed when pushed onto the stack. This
> behavior does not make sense to me and I am probably missing something
> simple about how to use the QUndoStack. Could someone offer an explanation
> of why my command gets executed? And also how do I get my undocommand on the
> stack **without** executing the command?

I haven't used QUndoStack much myself, but to me what you describe
does not make sense. An undo stack is supposed to represent what has
happened (this history), so why should a command not be executed when
pushed? Is it that you have already executed it manually?

Either way, I think a command will always be executed when pushed, so
that's what you need to work with. The -1 id thing seems to be just
for controlling the merging behavior.

Elvis

>
> Thanks
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@bluequartz.net
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QUndoStack

2016-06-17 Thread Elvis Stansvik
2016-06-17 19:33 GMT+02:00 Elvis Stansvik :
> 2016-06-17 18:18 GMT+02:00 Mike Jackson :
>> We are using the QUndoStack and when we "push()" onto the stack the actual
>> QUndoCommand is being executed. In the documentation is seems as though I
>> could set the "id" of the QUndoCommand to -1 and NOT have it executed but
>> after looking more close at the docs and the actual source code the
>> QUndoCommand will definitely be executed when pushed onto the stack. This
>> behavior does not make sense to me and I am probably missing something
>> simple about how to use the QUndoStack. Could someone offer an explanation
>> of why my command gets executed? And also how do I get my undocommand on the
>> stack **without** executing the command?
>
> I haven't used QUndoStack much myself, but to me what you describe
> does not make sense. An undo stack is supposed to represent what has
> happened (this history), so why should a command not be executed when

*the history.

> pushed? Is it that you have already executed it manually?
>
> Either way, I think a command will always be executed when pushed, so
> that's what you need to work with. The -1 id thing seems to be just
> for controlling the merging behavior.
>
> Elvis
>
>>
>> Thanks
>>
>> --
>> Michael A. Jackson
>> BlueQuartz Software, LLC
>> [e]: mike.jack...@bluequartz.net
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Jason H

You can of course use all of Qt without QtCreator. I've done it, and it's still possible.

 

When you have a resource, it becomes availible in the binary's asset system, and need not be distributed as a file on disk. This can prevent tampering if the binary is signed. Also I would assume that it gets loaded in the text segment of the executable and winds up on memory pages without the EXEC bit set. 

 

http://doc.qt.io/qt-5/resources.html

 

 

Sent: Friday, June 17, 2016 at 12:37 PM
From: "Max Savenkov" 
To: "Jason H" 
Cc: "Dmitry Volosnykh" , "" 
Subject: Re: [Interest] Routing all QML file requests through a custom resource provider


OK, but if I do not use QtCreator, is there no way to make it work? What does adding a qrc file to RESOURCES actually do (besides triggering resource compiler)? I'm looking for an understanding here.

 
2016-06-17 19:23 GMT+03:00 Jason H :


What Dimitry said plus:
 
Add:
CONFIG += resources_big

 
to your .pro file, which should get around some long linking times.
 
 
--
Sent: Friday, June 17, 2016 at 5:45 AM
From: "Dmitry Volosnykh" 
To: "Max Savenkov" , "" 
Subject: Re: [Interest] Routing all QML file requests through a custom resource provider


Hi, Max!
 
To be honest, I did not understand in all the details what you are trying to achieve. Anyway that looks way complex indeed.
 
Since you are inclined to pack all you resources into auxiliary file like zip package, you are surely okay with static content. Having this said, you should be fine using conventional .qrc files (this is what you named Qt resource system). These files are easily accessed (i.e. viewed, edited, etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as well. Also, there should be no issues when importing QML components from your .qml files once you feed QML engine with root .qml file stored inside .qrc file.
 
Regards,
Dmitry. 

On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov  wrote:Hello,

Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
development. The game is going to store all its resources in a package
(it might be zip, or a custom format) when deployed, but during
development, resources are available in the usual filesystem. This
difference is hidden by game's resource provider, which maps resource
name to a file or an entry in package.

This works for the game itself, but how can I make QML load images,
imports and other resources from game's resource provider? (also, I'd
like to view my QML files in Designer, which means I can't use custom
image providers in QML code itself)

I see two possibilities, but I'm not sure of either one.

1) Use dynamic resources produced by rcc. When loading a QML file from
C++, also load relevant rcc data (from game's resources) and register it
with Qt resource system to make it accessible. This sounds workable, but
I'm not sure how exactly to make it happen. Suppose I got a binary
buffer from game's resources. How do I register it in Qt?

2) Use a system of crutches.
* Register Url Interceptor with my QMLEngine, such that:
     - any URL that contains an image is changed into
"image:/my_resource_provider/imagename.png"
     - any URL that contains qml or qmldir is change into... What? There
is no way to register a special loader for QML imports. But I guess I
can change it into a network request, by substituting shcema to, for
example, "my_provider"
* Register image provider with name "my_resource_provider" that loads
images from my resource system.
* Register a custom network access manager factory/manager/network reply
that load QML files from my system instead of network. This doesn't
quite work, however, because QML at some point for whatever reason
checks that URL used to load qml file is local...

So, I'm stumped. This should be WAY easier... And it was, before
AbstractFileEngine was made private. But I really don't want to use
private APIs if I can avoid it.
An argument against AbstractFileEngine was made, that virtual FS should
be implemented "at OS level" - but I simply cannot see how a game can
implement it at OS level, because it's a game 0_o.
___
Interest mailing list

Interest@qt-project.org[Interest@qt-project.org]
http://lists.qt-project.org/mailman/listinfo/interest___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest[http://lists.qt-project.org/mailman/listinfo/interest]






___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Max Savenkov
OK, but if I do not use QtCreator, is there no way to make it work? What
does adding a qrc file to RESOURCES actually do (besides triggering
resource compiler)? I'm looking for an understanding here.

2016-06-17 19:23 GMT+03:00 Jason H :

>
> What Dimitry said plus:
>
> Add:
> CONFIG += resources_big
>
>
> to your .pro file, which should get around some long linking times.
>
>
> --
> Sent: Friday, June 17, 2016 at 5:45 AM
> From: "Dmitry Volosnykh" 
> To: "Max Savenkov" , "" <
> interest@qt-project.org>
> Subject: Re: [Interest] Routing all QML file requests through a custom
> resource provider
>
> Hi, Max!
>
> To be honest, I did not understand in all the details what you are trying
> to achieve. Anyway that looks way complex indeed.
>
> Since you are inclined to pack all you resources into auxiliary file like
> zip package, you are surely okay with static content. Having this said, you
> should be fine using conventional .qrc files (this is what you named Qt
> resource system). These files are easily accessed (i.e. viewed, edited,
> etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
> well. Also, there should be no issues when importing QML components from
> your .qml files once you feed QML engine with root .qml file stored inside
> .qrc file.
>
> Regards,
> Dmitry.
>
> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
> wrote:Hello,
>
> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
> development. The game is going to store all its resources in a package
> (it might be zip, or a custom format) when deployed, but during
> development, resources are available in the usual filesystem. This
> difference is hidden by game's resource provider, which maps resource
> name to a file or an entry in package.
>
> This works for the game itself, but how can I make QML load images,
> imports and other resources from game's resource provider? (also, I'd
> like to view my QML files in Designer, which means I can't use custom
> image providers in QML code itself)
>
> I see two possibilities, but I'm not sure of either one.
>
> 1) Use dynamic resources produced by rcc. When loading a QML file from
> C++, also load relevant rcc data (from game's resources) and register it
> with Qt resource system to make it accessible. This sounds workable, but
> I'm not sure how exactly to make it happen. Suppose I got a binary
> buffer from game's resources. How do I register it in Qt?
>
> 2) Use a system of crutches.
> * Register Url Interceptor with my QMLEngine, such that:
>  - any URL that contains an image is changed into
> "image:/my_resource_provider/imagename.png"
>  - any URL that contains qml or qmldir is change into... What? There
> is no way to register a special loader for QML imports. But I guess I
> can change it into a network request, by substituting shcema to, for
> example, "my_provider"
> * Register image provider with name "my_resource_provider" that loads
> images from my resource system.
> * Register a custom network access manager factory/manager/network reply
> that load QML files from my system instead of network. This doesn't
> quite work, however, because QML at some point for whatever reason
> checks that URL used to load qml file is local...
>
> So, I'm stumped. This should be WAY easier... And it was, before
> AbstractFileEngine was made private. But I really don't want to use
> private APIs if I can avoid it.
> An argument against AbstractFileEngine was made, that virtual FS should
> be implemented "at OS level" - but I simply cannot see how a game can
> implement it at OS level, because it's a game 0_o.
> ___
> Interest mailing list
> Interest@qt-project.org[Interest@qt-project.org]
>
> http://lists.qt-project.org/mailman/listinfo/interest___
> Interest mailing list Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest[http://lists.qt-project.org/mailman/listinfo/interest]
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Jason H

What Dimitry said plus:
 
Add:
CONFIG += resources_big

 
to your .pro file, which should get around some long linking times.
 
 
--
Sent: Friday, June 17, 2016 at 5:45 AM
From: "Dmitry Volosnykh" 
To: "Max Savenkov" , "" 

Subject: Re: [Interest] Routing all QML file requests through a custom resource 
provider

Hi, Max!
 
To be honest, I did not understand in all the details what you are trying to 
achieve. Anyway that looks way complex indeed.
 
Since you are inclined to pack all you resources into auxiliary file like zip 
package, you are surely okay with static content. Having this said, you should 
be fine using conventional .qrc files (this is what you named Qt resource 
system). These files are easily accessed (i.e. viewed, edited, etc.) from Qt 
Creator. Qt Designer tools understand them perfectly fine, as well. Also, there 
should be no issues when importing QML components from your .qml files once you 
feed QML engine with root .qml file stored inside .qrc file.
 
Regards,
Dmitry. 

On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov  
wrote:Hello,

Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
development. The game is going to store all its resources in a package
(it might be zip, or a custom format) when deployed, but during
development, resources are available in the usual filesystem. This
difference is hidden by game's resource provider, which maps resource
name to a file or an entry in package.

This works for the game itself, but how can I make QML load images,
imports and other resources from game's resource provider? (also, I'd
like to view my QML files in Designer, which means I can't use custom
image providers in QML code itself)

I see two possibilities, but I'm not sure of either one.

1) Use dynamic resources produced by rcc. When loading a QML file from
C++, also load relevant rcc data (from game's resources) and register it
with Qt resource system to make it accessible. This sounds workable, but
I'm not sure how exactly to make it happen. Suppose I got a binary
buffer from game's resources. How do I register it in Qt?

2) Use a system of crutches.
* Register Url Interceptor with my QMLEngine, such that:
     - any URL that contains an image is changed into
"image:/my_resource_provider/imagename.png"
     - any URL that contains qml or qmldir is change into... What? There
is no way to register a special loader for QML imports. But I guess I
can change it into a network request, by substituting shcema to, for
example, "my_provider"
* Register image provider with name "my_resource_provider" that loads
images from my resource system.
* Register a custom network access manager factory/manager/network reply
that load QML files from my system instead of network. This doesn't
quite work, however, because QML at some point for whatever reason
checks that URL used to load qml file is local...

So, I'm stumped. This should be WAY easier... And it was, before
AbstractFileEngine was made private. But I really don't want to use
private APIs if I can avoid it.
An argument against AbstractFileEngine was made, that virtual FS should
be implemented "at OS level" - but I simply cannot see how a game can
implement it at OS level, because it's a game 0_o.
___
Interest mailing list
Interest@qt-project.org[Interest@qt-project.org]
http://lists.qt-project.org/mailman/listinfo/interest___
 Interest mailing list Interest@qt-project.org 
http://lists.qt-project.org/mailman/listinfo/interest[http://lists.qt-project.org/mailman/listinfo/interest]
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] linux 64 5.7.0 WebEngine segfault

2016-06-17 Thread Kevin Mcintyre
When starting webengine - I get this error,

[0617/091642:ERROR:browser_main_loop.cc(217)] Running without the SUID
sandbox! See
https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md
for more information on developing with the sandbox on.

followed by this segfault

kernel: [37309.009921] Chrome_IOThread[7824]: segfault at 61 ip
7f65a7ae2baa sp 7f656cc18300 error 4 in
libQt5WebEngineCore.so.5.7.0[7f65a7486000+4e16000]

Any pointers as to how to resolve would be greatly appreciated.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] QUndoStack

2016-06-17 Thread Mike Jackson
We are using the QUndoStack and when we "push()" onto the stack the 
actual QUndoCommand is being executed. In the documentation is seems as 
though I could set the "id" of the QUndoCommand to -1 and NOT have it 
executed but after looking more close at the docs and the actual source 
code the QUndoCommand will definitely be executed when pushed onto the 
stack. This behavior does not make sense to me and I am probably missing 
something simple about how to use the QUndoStack. Could someone offer an 
explanation of why my command gets executed? And also how do I get my 
undocommand on the stack **without** executing the command?


Thanks

--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@bluequartz.net
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [qt3d] Loading textures from a custom file format

2016-06-17 Thread Xavier Bigand
I am trying to understand how I have to use QAbstractTexture and
QAbstractTextureImage to load textures from our custom format.

Our format is pretty simple and consist in a compressed file that contains
an header with all necessary informations :
 - texture size
 - precise texture format (PVRTCI_4bpp_RGBA, ETC1,...)
 - number of mipmaps

And it's naturally followed by the pixels buffer.

If I understand correctly how it works the best way to manage it is to
create a Texture class that will load the file and instantiate TextureImage
corresponding to the number of mipmaps level I have.

Am I right?

-- 
Xavier
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qt3D] Ununderstable message when closing a scene

2016-06-17 Thread Xavier Bigand
https://bugreports.qt.io/browse/QTBUG-54184

For the leaks I need to check, but firstly it seems that textures stay in
RAM even when already in VRAM.

2016-06-17 12:33 GMT+02:00 Sean Harmer :

> Hi,
>
> On Friday 17 June 2016 12:11:56 Xavier Bigand wrote:
> > I finally found a work around to fix my crash when loading models
> > after few unload.
> >
> > I simply release myself all children of the delete entity with the
> > following recursive method :
> >
> >
> > voidreleaseModel(Qt3DCore::QNode& model)
> >
> > {
> >
> > QEntity*entity = dynamic_cast(&model);
> >
> >
> > if (entity)
> >
> > {
> >
> > QComponentVectorcomponents = entity->components();
> >
> >
> > foreach (QComponent* component, components)
> >
> > {
> >
> > entity->removeComponent(component);
> >
> > delete component;
> >
> > }
> >
> > }
> >
> >
> > QNodeVector nodes = model.childNodes();
> >
> >
> > foreach (QNode* node, nodes)
> >
> > {
> >
> > releaseModel(*node);
> >
> > delete node;
> >
> > }
> >
> > }
> >
> >
> >
> > I don't know why I haven't the same behavior when letting Qt doing it.
> >
> >
> >
> > Need I fill a bug?
>
> Yes, please file a JIRA. Ideally with a test case. Also for any leaks you
> suspect.
>
> Thanks,
>
> Sean
>
> >
> >
> >
> > It seems that Qt3D have a lot of memory leaks, after changing a few
> > projects our application use more than 1Go when with our actual 3D engine
> > it's always lower than 200Mo.
> >
> > 2016-06-16 23:03 GMT+02:00 Xavier Bigand :
> > > Thank for the report.
> > >
> > > I was not sure if it wasn't me doing something wrong.
> > >
> > > But it might be the case, because the assert seems to come from a bad
> > > ressources management.
> > > When I switch projects I simply delete entities that attached to the
> root
> > > one, but doing this leads to the assert at a certain time and memory
> leaks
> > > apparently.
> > >
> > > My scenes are composed of objects that I load from a custom file
> format,
> > > it's for an architecture software.
> > >
> > > I can load 2 projects in a row, and on the third I get the assert.
> > >
> > > It seems that I can debug when using Visual instead of QtCreator. And
> it
> > > surprise me because the release of ressources seems to be done later
> than
> > > when I call the delete of entities.
> > >
> > > 2016-06-16 21:14 GMT+02:00 Harald Vistnes :
> > >> I get the same QMetaProperty::read warning. I just filed a Jira for
> it.
> > >> https://bugreports.qt.io/browse/QTBUG-54159?filter=17174
> > >>
> > >> Annoying and it came recently, but not critical as you can continue
> > >> running the debugger.
> > >>
> > >> Harald
> > >>
> > >> 2016-06-16 17:53 GMT+02:00 Xavier Bigand :
> > >>> Sometimes when it doesn't crash on the first scene switch I can get
> this
> > >>> assert :
> > >>> ASSERT: "m_entries[index].m_counter == handle.counter()" in file
> > >>> c:/Users/qt/work/qt/qt3d/src/core/resources/qhandlemanager_p.h, line
> 170
> > >>>
> > >>> Sadly it seems that I am not able to debug it with source code.
> > >>>
> > >>> 2016-06-16 17:35 GMT+02:00 Xavier Bigand  >:
> >  I am getting the following message when I unload a scene. I am
> simply
> >  deleting the entities I don't have to display anymore.
> > 
> >  QMetaProperty::read: Unable to handle unregistered datatype
> >  'Qt3DRender::QBuffer*' for property 'Qt3DRender::QAttribute::buffer'
> > 
> >  What is the proper way to unload meshes in c++? Need I also delete
> all
> >  attached components (QGeometryRenderer, QBuffer, ...)?
> > 
> >  --
> >  Xavier
> > >>>
> > >>> --
> > >>> Xavier
> > >>>
> > >>> ___
> > >>> Interest mailing list
> > >>> Interest@qt-project.org
> > >>> http://lists.qt-project.org/mailman/listinfo/interest
> > >
> > > --
> > > Xavier
>
> --
> Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
> Klarälvdalens Datakonsult AB, a KDAB Group company
> Tel. UK +44 (0)1625 809908, Sweden (HQ) +46-563-540090
> KDAB - Qt Experts - Platform-independent software solutions
>



-- 
Xavier
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Packaging a Qt App for Linux/MacOSX/Windows

2016-06-17 Thread Ch'Gans
Hi there,

I've recently added a (very basic) offline installer to my project
using the Qt installer framework and i'm looking for a multi platform
solution to detect my app dependencies and to ship (some of) them into
my installer.
Ideally I would like to automate this...

The following pages gives lot of hints and advices:
http://doc.qt.io/qt-5/osx-deployment.html
http://doc.qt.io/qt-5/linux-deployment.html
http://doc.qt.io/qt-5/windows-deployment.html

Some of the tricks in there rely on qmake features, but unfortunately
I'm using Qbs...

Does anyone has any recommendation, tools, examples, magic scripts, or
other useful stuff to point out?

Thanks for sharing,
Chris
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Dmitry Volosnykh
You may want to install QtCreator for, at least, to use it as a tool to
quick dive into the examples. I realize that this is by no means what you
are after, but I think that worth it.

On Fri, Jun 17, 2016 at 2:06 PM Max Savenkov  wrote:

> 1) I'm not using QtCreator, but Visual Studio
> 2) Even if I did, adding file to RESOURCES variable would not allow me to
> put it inside my own package. While it might be OK to have separate
> resource packages for the main game and Qt, I'd like to avoid it if
> possible.
>
> 2016-06-17 13:58 GMT+03:00 Dmitry Volosnykh :
>
>> Usually, you don't need to do anything to "register" you resources file.
>> Basically, you add .qrc filename to RESOURCES variable inside qmake's
>> project file. After that you are able to refer to its contents via "qrc"
>> protocol (in terms of URI) for either QFile or QUrl, etc.
>>
>> By the way, have you looked into examples provided with QtCreator. I am
>> pretty sure that there are a plenty of examples exploting this
>> functionality.
>>
>> On Fri, Jun 17, 2016 at 1:45 PM Max Savenkov 
>> wrote:
>>
>>> Hi Dmitry,
>>>
>>> As a understand it, qrc is just an index file. I still need to provide
>>> binary data it refers to somehow. Basically, what I don't understand is
>>> this passage in documentation: "a binary resource can be created and at a
>>> later point in application code registered with the resource system.".
>>> Looking at header file, I can see two ways to register a rcc file. This
>>> first is by specifying filename to QResource::registerResource. That one
>>> won't work, since Qt will try to load this file from conventional
>>> filesystem, while it is really located in my resource provider (basically,
>>> in memory).
>>>
>>> There is a second overload of registerResource, which takes a pointer to
>>> rccData. Which LOOKS like that I need, but it suspiciously missing "size"
>>> argument, so I'm not really sure what this call does. Unless, of course, it
>>> just registers a pointer to memory as a resource and just assumes it's a
>>> correctly formatted output of rcc that at least contains some header with
>>> size? In which case I certainly can use it, and it will solve my problems,
>>> but then it seems unsafe to me.
>>>
>>>
>>> 2016-06-17 12:45 GMT+03:00 Dmitry Volosnykh 
>>> :
>>>
 Hi, Max!

 To be honest, I did not understand in all the details what you are
 trying to achieve. Anyway that looks way complex indeed.

 Since you are inclined to pack all you resources into auxiliary file
 like zip package, you are surely okay with static content. Having this
 said, you should be fine using conventional .qrc files (this is what you
 named Qt resource system). These files are easily accessed (i.e. viewed,
 edited, etc.) from Qt Creator. Qt Designer tools understand them perfectly
 fine, as well. Also, there should be no issues when importing QML
 components from your .qml files once you feed QML engine with root .qml
 file stored inside .qrc file.

 Regards,
 Dmitry.

 On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
 wrote:

> Hello,
>
> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
> development. The game is going to store all its resources in a package
> (it might be zip, or a custom format) when deployed, but during
> development, resources are available in the usual filesystem. This
> difference is hidden by game's resource provider, which maps resource
> name to a file or an entry in package.
>
> This works for the game itself, but how can I make QML load images,
> imports and other resources from game's resource provider? (also, I'd
> like to view my QML files in Designer, which means I can't use custom
> image providers in QML code itself)
>
> I see two possibilities, but I'm not sure of either one.
>
> 1) Use dynamic resources produced by rcc. When loading a QML file from
> C++, also load relevant rcc data (from game's resources) and register
> it
> with Qt resource system to make it accessible. This sounds workable,
> but
> I'm not sure how exactly to make it happen. Suppose I got a binary
> buffer from game's resources. How do I register it in Qt?
>
> 2) Use a system of crutches.
> * Register Url Interceptor with my QMLEngine, such that:
>  - any URL that contains an image is changed into
> "image:/my_resource_provider/imagename.png"
>  - any URL that contains qml or qmldir is change into... What?
> There
> is no way to register a special loader for QML imports. But I guess I
> can change it into a network request, by substituting shcema to, for
> example, "my_provider"
> * Register image provider with name "my_resource_provider" that loads
> images from my resource system.
> * Register a custom network access manager factory/manager/network
> reply
> that load QML fi

Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Max Savenkov
1) I'm not using QtCreator, but Visual Studio
2) Even if I did, adding file to RESOURCES variable would not allow me to
put it inside my own package. While it might be OK to have separate
resource packages for the main game and Qt, I'd like to avoid it if
possible.

2016-06-17 13:58 GMT+03:00 Dmitry Volosnykh :

> Usually, you don't need to do anything to "register" you resources file.
> Basically, you add .qrc filename to RESOURCES variable inside qmake's
> project file. After that you are able to refer to its contents via "qrc"
> protocol (in terms of URI) for either QFile or QUrl, etc.
>
> By the way, have you looked into examples provided with QtCreator. I am
> pretty sure that there are a plenty of examples exploting this
> functionality.
>
> On Fri, Jun 17, 2016 at 1:45 PM Max Savenkov 
> wrote:
>
>> Hi Dmitry,
>>
>> As a understand it, qrc is just an index file. I still need to provide
>> binary data it refers to somehow. Basically, what I don't understand is
>> this passage in documentation: "a binary resource can be created and at a
>> later point in application code registered with the resource system.".
>> Looking at header file, I can see two ways to register a rcc file. This
>> first is by specifying filename to QResource::registerResource. That one
>> won't work, since Qt will try to load this file from conventional
>> filesystem, while it is really located in my resource provider (basically,
>> in memory).
>>
>> There is a second overload of registerResource, which takes a pointer to
>> rccData. Which LOOKS like that I need, but it suspiciously missing "size"
>> argument, so I'm not really sure what this call does. Unless, of course, it
>> just registers a pointer to memory as a resource and just assumes it's a
>> correctly formatted output of rcc that at least contains some header with
>> size? In which case I certainly can use it, and it will solve my problems,
>> but then it seems unsafe to me.
>>
>>
>> 2016-06-17 12:45 GMT+03:00 Dmitry Volosnykh :
>>
>>> Hi, Max!
>>>
>>> To be honest, I did not understand in all the details what you are
>>> trying to achieve. Anyway that looks way complex indeed.
>>>
>>> Since you are inclined to pack all you resources into auxiliary file
>>> like zip package, you are surely okay with static content. Having this
>>> said, you should be fine using conventional .qrc files (this is what you
>>> named Qt resource system). These files are easily accessed (i.e. viewed,
>>> edited, etc.) from Qt Creator. Qt Designer tools understand them perfectly
>>> fine, as well. Also, there should be no issues when importing QML
>>> components from your .qml files once you feed QML engine with root .qml
>>> file stored inside .qrc file.
>>>
>>> Regards,
>>> Dmitry.
>>>
>>> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
>>> wrote:
>>>
 Hello,

 Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
 development. The game is going to store all its resources in a package
 (it might be zip, or a custom format) when deployed, but during
 development, resources are available in the usual filesystem. This
 difference is hidden by game's resource provider, which maps resource
 name to a file or an entry in package.

 This works for the game itself, but how can I make QML load images,
 imports and other resources from game's resource provider? (also, I'd
 like to view my QML files in Designer, which means I can't use custom
 image providers in QML code itself)

 I see two possibilities, but I'm not sure of either one.

 1) Use dynamic resources produced by rcc. When loading a QML file from
 C++, also load relevant rcc data (from game's resources) and register it
 with Qt resource system to make it accessible. This sounds workable, but
 I'm not sure how exactly to make it happen. Suppose I got a binary
 buffer from game's resources. How do I register it in Qt?

 2) Use a system of crutches.
 * Register Url Interceptor with my QMLEngine, such that:
  - any URL that contains an image is changed into
 "image:/my_resource_provider/imagename.png"
  - any URL that contains qml or qmldir is change into... What? There
 is no way to register a special loader for QML imports. But I guess I
 can change it into a network request, by substituting shcema to, for
 example, "my_provider"
 * Register image provider with name "my_resource_provider" that loads
 images from my resource system.
 * Register a custom network access manager factory/manager/network reply
 that load QML files from my system instead of network. This doesn't
 quite work, however, because QML at some point for whatever reason
 checks that URL used to load qml file is local...

 So, I'm stumped. This should be WAY easier... And it was, before
 AbstractFileEngine was made private. But I really don't want to use
 private APIs if I can avoid it.
 An

Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Dmitry Volosnykh
Usually, you don't need to do anything to "register" you resources file.
Basically, you add .qrc filename to RESOURCES variable inside qmake's
project file. After that you are able to refer to its contents via "qrc"
protocol (in terms of URI) for either QFile or QUrl, etc.

By the way, have you looked into examples provided with QtCreator. I am
pretty sure that there are a plenty of examples exploting this
functionality.

On Fri, Jun 17, 2016 at 1:45 PM Max Savenkov  wrote:

> Hi Dmitry,
>
> As a understand it, qrc is just an index file. I still need to provide
> binary data it refers to somehow. Basically, what I don't understand is
> this passage in documentation: "a binary resource can be created and at a
> later point in application code registered with the resource system.".
> Looking at header file, I can see two ways to register a rcc file. This
> first is by specifying filename to QResource::registerResource. That one
> won't work, since Qt will try to load this file from conventional
> filesystem, while it is really located in my resource provider (basically,
> in memory).
>
> There is a second overload of registerResource, which takes a pointer to
> rccData. Which LOOKS like that I need, but it suspiciously missing "size"
> argument, so I'm not really sure what this call does. Unless, of course, it
> just registers a pointer to memory as a resource and just assumes it's a
> correctly formatted output of rcc that at least contains some header with
> size? In which case I certainly can use it, and it will solve my problems,
> but then it seems unsafe to me.
>
>
> 2016-06-17 12:45 GMT+03:00 Dmitry Volosnykh :
>
>> Hi, Max!
>>
>> To be honest, I did not understand in all the details what you are trying
>> to achieve. Anyway that looks way complex indeed.
>>
>> Since you are inclined to pack all you resources into auxiliary file like
>> zip package, you are surely okay with static content. Having this said, you
>> should be fine using conventional .qrc files (this is what you named Qt
>> resource system). These files are easily accessed (i.e. viewed, edited,
>> etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
>> well. Also, there should be no issues when importing QML components from
>> your .qml files once you feed QML engine with root .qml file stored inside
>> .qrc file.
>>
>> Regards,
>> Dmitry.
>>
>> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
>> wrote:
>>
>>> Hello,
>>>
>>> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
>>> development. The game is going to store all its resources in a package
>>> (it might be zip, or a custom format) when deployed, but during
>>> development, resources are available in the usual filesystem. This
>>> difference is hidden by game's resource provider, which maps resource
>>> name to a file or an entry in package.
>>>
>>> This works for the game itself, but how can I make QML load images,
>>> imports and other resources from game's resource provider? (also, I'd
>>> like to view my QML files in Designer, which means I can't use custom
>>> image providers in QML code itself)
>>>
>>> I see two possibilities, but I'm not sure of either one.
>>>
>>> 1) Use dynamic resources produced by rcc. When loading a QML file from
>>> C++, also load relevant rcc data (from game's resources) and register it
>>> with Qt resource system to make it accessible. This sounds workable, but
>>> I'm not sure how exactly to make it happen. Suppose I got a binary
>>> buffer from game's resources. How do I register it in Qt?
>>>
>>> 2) Use a system of crutches.
>>> * Register Url Interceptor with my QMLEngine, such that:
>>>  - any URL that contains an image is changed into
>>> "image:/my_resource_provider/imagename.png"
>>>  - any URL that contains qml or qmldir is change into... What? There
>>> is no way to register a special loader for QML imports. But I guess I
>>> can change it into a network request, by substituting shcema to, for
>>> example, "my_provider"
>>> * Register image provider with name "my_resource_provider" that loads
>>> images from my resource system.
>>> * Register a custom network access manager factory/manager/network reply
>>> that load QML files from my system instead of network. This doesn't
>>> quite work, however, because QML at some point for whatever reason
>>> checks that URL used to load qml file is local...
>>>
>>> So, I'm stumped. This should be WAY easier... And it was, before
>>> AbstractFileEngine was made private. But I really don't want to use
>>> private APIs if I can avoid it.
>>> An argument against AbstractFileEngine was made, that virtual FS should
>>> be implemented "at OS level" - but I simply cannot see how a game can
>>> implement it at OS level, because it's a game 0_o.
>>> ___
>>> Interest mailing list
>>> Interest@qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>
>>
>
___

Re: [Interest] How to set absolute Qt3D::QCamera rotation/orientation

2016-06-17 Thread Sean Harmer
Hi,

On Friday 17 June 2016 13:36:40 Oleg Evseev wrote:
> Qt3DRender::QCamera as an QEntity has QTransform component. You can get it
> with help of Qt3DCore::QTransform *transform() const function and then
> setTranslation, setRotation or setMatrix for it as you wish.
> 
> Maybe that is what are you looking for?

Sorry didn't see this as I was away on vacation when it arrived and got lost 
in my backlog.

Yes, as Oleg suggests or make your own QEntity subclass that aggregates a 
QTransform and QCameraLens and give it the API you need. All the renderer 
looks for in a camera is a QCameraLens for the projection matrix and a 
transform for the view matrix.

If you'd like to see some more convenience API on QCamera itself then please 
file a JIRA with your suggestions.

Cheers,

Sean

> 
> Regards, Oleg.
> 
> 2016-06-08 14:32 GMT+03:00 Ola Røer Thorsen :
> > I need to set a Qt3D::QCamera orientation directly. I've got the position
> > in a QVector3D and the rotation in a QQuaternion. I can't seem to find any
> > API for this. The "rotate"-function just adds my quaternion to the
> > existing
> > orientation which is not what I'm looking for. Is there some better way to
> > do this?
> > 
> > Cheers,
> > Ola
> > 
> > 
> > 
> > 
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest

--
Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. UK +44 (0)1625 809908, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qt 3D] Entities with custom meshes disappear when there are many of them in one place

2016-06-17 Thread Oleg Evseev
If suddenly somebody are interested in this case, such behavior was related
to PhongAlphaMaterial (even with alpha=1.0) in scene within Scene3D qml
Item inside qml Loader.
When using PhongMaterial instead everything works fine.

I filed a JIRA about related issues:
https://bugreports.qt.io/browse/QTBUG-53935

Regards, Oleg


2016-05-01 23:57 GMT+03:00 Oleg Evseev :

> Hi,
>
> Not going into details just the main point:
>
> In my scene I have huge ground plane and on top of it I draw car path.
> I break path mesh into peaces, create new entity with QGeometryRenderer,
> meshGeometry and so on in it and append it to my current parent Entity.
> When vertex array get filled, I create new one and so on.
> It works, but when car starts driving by round almost at the same loop
> place, all Entities of that loop suddenly disappear (at a moment when car
> trying to pass almost same way in fifth time) and no new Entities (even
> when car drives out from loop) are not shown anymore (despite they are
> added to scene).
>
> Here https://www.youtube.com/watch?v=InxhSB_YuhU I recorded video
> illustrated this problem.
> Windows 7 x64, Qt 5.6
>
> Maybe those problems related to OpenGl realization in Windows/video card
> drivers?
>
> Thank for help in advance.
>
> Regard, Oleg
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Max Savenkov
Hi Dmitry,

As a understand it, qrc is just an index file. I still need to provide
binary data it refers to somehow. Basically, what I don't understand is
this passage in documentation: "a binary resource can be created and at a
later point in application code registered with the resource system.".
Looking at header file, I can see two ways to register a rcc file. This
first is by specifying filename to QResource::registerResource. That one
won't work, since Qt will try to load this file from conventional
filesystem, while it is really located in my resource provider (basically,
in memory).

There is a second overload of registerResource, which takes a pointer to
rccData. Which LOOKS like that I need, but it suspiciously missing "size"
argument, so I'm not really sure what this call does. Unless, of course, it
just registers a pointer to memory as a resource and just assumes it's a
correctly formatted output of rcc that at least contains some header with
size? In which case I certainly can use it, and it will solve my problems,
but then it seems unsafe to me.


2016-06-17 12:45 GMT+03:00 Dmitry Volosnykh :

> Hi, Max!
>
> To be honest, I did not understand in all the details what you are trying
> to achieve. Anyway that looks way complex indeed.
>
> Since you are inclined to pack all you resources into auxiliary file like
> zip package, you are surely okay with static content. Having this said, you
> should be fine using conventional .qrc files (this is what you named Qt
> resource system). These files are easily accessed (i.e. viewed, edited,
> etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
> well. Also, there should be no issues when importing QML components from
> your .qml files once you feed QML engine with root .qml file stored inside
> .qrc file.
>
> Regards,
> Dmitry.
>
> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
> wrote:
>
>> Hello,
>>
>> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
>> development. The game is going to store all its resources in a package
>> (it might be zip, or a custom format) when deployed, but during
>> development, resources are available in the usual filesystem. This
>> difference is hidden by game's resource provider, which maps resource
>> name to a file or an entry in package.
>>
>> This works for the game itself, but how can I make QML load images,
>> imports and other resources from game's resource provider? (also, I'd
>> like to view my QML files in Designer, which means I can't use custom
>> image providers in QML code itself)
>>
>> I see two possibilities, but I'm not sure of either one.
>>
>> 1) Use dynamic resources produced by rcc. When loading a QML file from
>> C++, also load relevant rcc data (from game's resources) and register it
>> with Qt resource system to make it accessible. This sounds workable, but
>> I'm not sure how exactly to make it happen. Suppose I got a binary
>> buffer from game's resources. How do I register it in Qt?
>>
>> 2) Use a system of crutches.
>> * Register Url Interceptor with my QMLEngine, such that:
>>  - any URL that contains an image is changed into
>> "image:/my_resource_provider/imagename.png"
>>  - any URL that contains qml or qmldir is change into... What? There
>> is no way to register a special loader for QML imports. But I guess I
>> can change it into a network request, by substituting shcema to, for
>> example, "my_provider"
>> * Register image provider with name "my_resource_provider" that loads
>> images from my resource system.
>> * Register a custom network access manager factory/manager/network reply
>> that load QML files from my system instead of network. This doesn't
>> quite work, however, because QML at some point for whatever reason
>> checks that URL used to load qml file is local...
>>
>> So, I'm stumped. This should be WAY easier... And it was, before
>> AbstractFileEngine was made private. But I really don't want to use
>> private APIs if I can avoid it.
>> An argument against AbstractFileEngine was made, that virtual FS should
>> be implemented "at OS level" - but I simply cannot see how a game can
>> implement it at OS level, because it's a game 0_o.
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to set absolute Qt3D::QCamera rotation/orientation

2016-06-17 Thread Oleg Evseev
Qt3DRender::QCamera as an QEntity has QTransform component. You can get it
with help of Qt3DCore::QTransform *transform() const function and then
setTranslation, setRotation or setMatrix for it as you wish.

Maybe that is what are you looking for?

Regards, Oleg.

2016-06-08 14:32 GMT+03:00 Ola Røer Thorsen :

> I need to set a Qt3D::QCamera orientation directly. I've got the position
> in a QVector3D and the rotation in a QQuaternion. I can't seem to find any
> API for this. The "rotate"-function just adds my quaternion to the existing
> orientation which is not what I'm looking for. Is there some better way to
> do this?
>
> Cheers,
> Ola
>
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qt3D] Ununderstable message when closing a scene

2016-06-17 Thread Sean Harmer
Hi,

On Friday 17 June 2016 12:11:56 Xavier Bigand wrote:
> I finally found a work around to fix my crash when loading models
> after few unload.
> 
> I simply release myself all children of the delete entity with the
> following recursive method :
> 
> 
> voidreleaseModel(Qt3DCore::QNode& model)
> 
> {
> 
> QEntity*entity = dynamic_cast(&model);
> 
> 
> if (entity)
> 
> {
> 
> QComponentVectorcomponents = entity->components();
> 
> 
> foreach (QComponent* component, components)
> 
> {
> 
> entity->removeComponent(component);
> 
> delete component;
> 
> }
> 
> }
> 
> 
> QNodeVector nodes = model.childNodes();
> 
> 
> foreach (QNode* node, nodes)
> 
> {
> 
> releaseModel(*node);
> 
> delete node;
> 
> }
> 
> }
> 
> 
> 
> I don't know why I haven't the same behavior when letting Qt doing it.
> 
> 
> 
> Need I fill a bug?

Yes, please file a JIRA. Ideally with a test case. Also for any leaks you 
suspect.

Thanks,

Sean

> 
> 
> 
> It seems that Qt3D have a lot of memory leaks, after changing a few
> projects our application use more than 1Go when with our actual 3D engine
> it's always lower than 200Mo.
> 
> 2016-06-16 23:03 GMT+02:00 Xavier Bigand :
> > Thank for the report.
> > 
> > I was not sure if it wasn't me doing something wrong.
> > 
> > But it might be the case, because the assert seems to come from a bad
> > ressources management.
> > When I switch projects I simply delete entities that attached to the root
> > one, but doing this leads to the assert at a certain time and memory leaks
> > apparently.
> > 
> > My scenes are composed of objects that I load from a custom file format,
> > it's for an architecture software.
> > 
> > I can load 2 projects in a row, and on the third I get the assert.
> > 
> > It seems that I can debug when using Visual instead of QtCreator. And it
> > surprise me because the release of ressources seems to be done later than
> > when I call the delete of entities.
> > 
> > 2016-06-16 21:14 GMT+02:00 Harald Vistnes :
> >> I get the same QMetaProperty::read warning. I just filed a Jira for it.
> >> https://bugreports.qt.io/browse/QTBUG-54159?filter=17174
> >> 
> >> Annoying and it came recently, but not critical as you can continue
> >> running the debugger.
> >> 
> >> Harald
> >> 
> >> 2016-06-16 17:53 GMT+02:00 Xavier Bigand :
> >>> Sometimes when it doesn't crash on the first scene switch I can get this
> >>> assert :
> >>> ASSERT: "m_entries[index].m_counter == handle.counter()" in file
> >>> c:/Users/qt/work/qt/qt3d/src/core/resources/qhandlemanager_p.h, line 170
> >>> 
> >>> Sadly it seems that I am not able to debug it with source code.
> >>> 
> >>> 2016-06-16 17:35 GMT+02:00 Xavier Bigand :
>  I am getting the following message when I unload a scene. I am simply
>  deleting the entities I don't have to display anymore.
>  
>  QMetaProperty::read: Unable to handle unregistered datatype
>  'Qt3DRender::QBuffer*' for property 'Qt3DRender::QAttribute::buffer'
>  
>  What is the proper way to unload meshes in c++? Need I also delete all
>  attached components (QGeometryRenderer, QBuffer, ...)?
>  
>  --
>  Xavier
> >>> 
> >>> --
> >>> Xavier
> >>> 
> >>> ___
> >>> Interest mailing list
> >>> Interest@qt-project.org
> >>> http://lists.qt-project.org/mailman/listinfo/interest
> > 
> > --
> > Xavier

--
Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. UK +44 (0)1625 809908, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qt3D] Ununderstable message when closing a scene

2016-06-17 Thread Xavier Bigand
I finally found a work around to fix my crash when loading models
after few unload.

I simply release myself all children of the delete entity with the
following recursive method :


voidreleaseModel(Qt3DCore::QNode& model)

{

QEntity*entity = dynamic_cast(&model);


if (entity)

{

QComponentVectorcomponents = entity->components();


foreach (QComponent* component, components)

{

entity->removeComponent(component);

delete component;

}

}


QNodeVector nodes = model.childNodes();


foreach (QNode* node, nodes)

{

releaseModel(*node);

delete node;

}

}



I don't know why I haven't the same behavior when letting Qt doing it.



Need I fill a bug?



It seems that Qt3D have a lot of memory leaks, after changing a few
projects our application use more than 1Go when with our actual 3D engine
it's always lower than 200Mo.


2016-06-16 23:03 GMT+02:00 Xavier Bigand :

> Thank for the report.
>
> I was not sure if it wasn't me doing something wrong.
>
> But it might be the case, because the assert seems to come from a bad
> ressources management.
> When I switch projects I simply delete entities that attached to the root
> one, but doing this leads to the assert at a certain time and memory leaks
> apparently.
>
> My scenes are composed of objects that I load from a custom file format,
> it's for an architecture software.
>
> I can load 2 projects in a row, and on the third I get the assert.
>
> It seems that I can debug when using Visual instead of QtCreator. And it
> surprise me because the release of ressources seems to be done later than
> when I call the delete of entities.
>
>
> 2016-06-16 21:14 GMT+02:00 Harald Vistnes :
>
>> I get the same QMetaProperty::read warning. I just filed a Jira for it.
>> https://bugreports.qt.io/browse/QTBUG-54159?filter=17174
>>
>> Annoying and it came recently, but not critical as you can continue
>> running the debugger.
>>
>> Harald
>>
>> 2016-06-16 17:53 GMT+02:00 Xavier Bigand :
>>
>>> Sometimes when it doesn't crash on the first scene switch I can get this
>>> assert :
>>> ASSERT: "m_entries[index].m_counter == handle.counter()" in file
>>> c:/Users/qt/work/qt/qt3d/src/core/resources/qhandlemanager_p.h, line 170
>>>
>>> Sadly it seems that I am not able to debug it with source code.
>>>
>>> 2016-06-16 17:35 GMT+02:00 Xavier Bigand :
>>>
 I am getting the following message when I unload a scene. I am simply
 deleting the entities I don't have to display anymore.

 QMetaProperty::read: Unable to handle unregistered datatype
 'Qt3DRender::QBuffer*' for property 'Qt3DRender::QAttribute::buffer'

 What is the proper way to unload meshes in c++? Need I also delete all
 attached components (QGeometryRenderer, QBuffer, ...)?

 --
 Xavier

>>>
>>>
>>>
>>> --
>>> Xavier
>>>
>>> ___
>>> Interest mailing list
>>> Interest@qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>
>>>
>>
>
>
> --
> Xavier
>



-- 
Xavier
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Dmitry Volosnykh
Hi, Max!

To be honest, I did not understand in all the details what you are trying
to achieve. Anyway that looks way complex indeed.

Since you are inclined to pack all you resources into auxiliary file like
zip package, you are surely okay with static content. Having this said, you
should be fine using conventional .qrc files (this is what you named Qt
resource system). These files are easily accessed (i.e. viewed, edited,
etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
well. Also, there should be no issues when importing QML components from
your .qml files once you feed QML engine with root .qml file stored inside
.qrc file.

Regards,
Dmitry.

On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov 
wrote:

> Hello,
>
> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
> development. The game is going to store all its resources in a package
> (it might be zip, or a custom format) when deployed, but during
> development, resources are available in the usual filesystem. This
> difference is hidden by game's resource provider, which maps resource
> name to a file or an entry in package.
>
> This works for the game itself, but how can I make QML load images,
> imports and other resources from game's resource provider? (also, I'd
> like to view my QML files in Designer, which means I can't use custom
> image providers in QML code itself)
>
> I see two possibilities, but I'm not sure of either one.
>
> 1) Use dynamic resources produced by rcc. When loading a QML file from
> C++, also load relevant rcc data (from game's resources) and register it
> with Qt resource system to make it accessible. This sounds workable, but
> I'm not sure how exactly to make it happen. Suppose I got a binary
> buffer from game's resources. How do I register it in Qt?
>
> 2) Use a system of crutches.
> * Register Url Interceptor with my QMLEngine, such that:
>  - any URL that contains an image is changed into
> "image:/my_resource_provider/imagename.png"
>  - any URL that contains qml or qmldir is change into... What? There
> is no way to register a special loader for QML imports. But I guess I
> can change it into a network request, by substituting shcema to, for
> example, "my_provider"
> * Register image provider with name "my_resource_provider" that loads
> images from my resource system.
> * Register a custom network access manager factory/manager/network reply
> that load QML files from my system instead of network. This doesn't
> quite work, however, because QML at some point for whatever reason
> checks that URL used to load qml file is local...
>
> So, I'm stumped. This should be WAY easier... And it was, before
> AbstractFileEngine was made private. But I really don't want to use
> private APIs if I can avoid it.
> An argument against AbstractFileEngine was made, that virtual FS should
> be implemented "at OS level" - but I simply cannot see how a game can
> implement it at OS level, because it's a game 0_o.
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Max Savenkov

Hello,

Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game 
development. The game is going to store all its resources in a package 
(it might be zip, or a custom format) when deployed, but during 
development, resources are available in the usual filesystem. This 
difference is hidden by game's resource provider, which maps resource 
name to a file or an entry in package.


This works for the game itself, but how can I make QML load images, 
imports and other resources from game's resource provider? (also, I'd 
like to view my QML files in Designer, which means I can't use custom 
image providers in QML code itself)


I see two possibilities, but I'm not sure of either one.

1) Use dynamic resources produced by rcc. When loading a QML file from 
C++, also load relevant rcc data (from game's resources) and register it 
with Qt resource system to make it accessible. This sounds workable, but 
I'm not sure how exactly to make it happen. Suppose I got a binary 
buffer from game's resources. How do I register it in Qt?


2) Use a system of crutches.
* Register Url Interceptor with my QMLEngine, such that:
- any URL that contains an image is changed into 
"image:/my_resource_provider/imagename.png"
- any URL that contains qml or qmldir is change into... What? There 
is no way to register a special loader for QML imports. But I guess I 
can change it into a network request, by substituting shcema to, for 
example, "my_provider"
* Register image provider with name "my_resource_provider" that loads 
images from my resource system.
* Register a custom network access manager factory/manager/network reply 
that load QML files from my system instead of network. This doesn't 
quite work, however, because QML at some point for whatever reason 
checks that URL used to load qml file is local...


So, I'm stumped. This should be WAY easier... And it was, before 
AbstractFileEngine was made private. But I really don't want to use 
private APIs if I can avoid it.
An argument against AbstractFileEngine was made, that virtual FS should 
be implemented "at OS level" - but I simply cannot see how a game can 
implement it at OS level, because it's a game 0_o.

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest