[Solved] [Qt5] How register my own QIODevice (replacement of QAbstractFileEngineHandler)
-
Without any code, initialization etc… I can't tell
-
I finally made it work on Windows, but not Android that is my main target for the moment.
The issue was my read implementation that didn't return the correct size cause I mess the check of the end of file.
I am using the same code and package file on android but I still have the same issue.What part of code do you need?
Is there a way to associate Qt code to the debugger to be able to understand where it failed to load the component and for what condition? That was the method I used to find the issue on read implementation.
-
You can use the debugger the same way
The implementation of your custom file engine handler, however it might be easier if the code is big to either use a pastbin site or if you have a repository to look at
-
I had try to add mapping to Qt sources to the debugger, but I am not able to see it, QtCreator always show me the asm of Qt.
I have found a little workaround, I can load qml files from the user backup directory and images from my package, so the issue seems to be specific of the way qml files are loaded. I certainly do something wrong with text file that cause some parsing issues, but it strange in this case that it's works on Windows.
Here is my implementation of the QAbstractFileEngine :
http://pastebin.com/ZnMFVdDV
http://pastebin.com/rf9wuein -
@mCurrentDir = QDir::current().path() + "/";@
Looks dangerous to me, it's probably not what you assume it is on android
-
[quote author="SGaist" date="1410898531"]@mCurrentDir = QDir::current().path() + "/";@
Looks dangerous to me, it's probably not what you assume it is on android[/quote]
You are right, it's certainly better for my to check if the path contains my package name then removing everything before to clean file path.
-
If you want you own application folder your can use Q(Gui)Application for that.
-
-
You're welcome !
Just edit your original post and update the thread title :)