black squares instead of icons

Dirk Hohndel dirk at hohndel.org
Thu Dec 24 16:53:31 PST 2015


> On Dec 24, 2015, at 3:41 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> 
> On 25 December 2015 at 00:11, Dirk Hohndel <dirk at hohndel.org> wrote:
>> 
>> If I were able to create debug output from within the .qml files I could
>> try to figure out what the complete path is that is assembled in
>> mobilecomponents/Icon.qml - my only working hypothesis is that under some
>> circumstance that ends up not creating the correct relative path - but
>> that's extremely weak.
>> 
> 
> in mobilecomponents/Icon.qml you can try adding the following slot:
> 
> Image {
>        id: image
>        anchors.fill: parent
>        source: root.source != "" ? (root.source.indexOf(".") === -1 ?
> "icons/" + root.source + ".svg" : root.source) : root.source
>        sourceSize.width: root.width
>        sourceSize.height: root.height
> 
> // ------------------- SLOT -----------------
> onSourceChanged: {
>   print(image.source);
> }
> // -----------------------------------------------
>    }
> 
> to see what path the image receives. the resources on native Android
> applications are in a "res" folder inside the APK (ZIP), but i don't
> know how Qt does it.
> 
> this thread right here suggests a workaround at the very bottom to put
> all icons in an offscreen Repeater, which solves a similar "black
> icons" problem:
> https://github.com/papyros/qml-material/issues/267
> 
> it does not mention the "Failure retrieving resources" warning, which
> could be signaling about the root cause (i.e. the PackageManager is
> not finding a Drawable), but it could be about something else - i.e.
> the warnings are about some other assets and the cause for the black
> icons is elsewhere.
> 
> as a side note, i would also try removing the GammaAdjust bellow the
> "Image" component, just to make sure it's not a OpenGLES /
> glCreateShaderProgram() issue.
> GammaAdjust is ShaderEffect (QQuickShaderEffect) based and while the
> GLSL for it is super simple i can confirm that ShaderEffect has at
> least one bug that i know of in Qt 5.5.1.

I have tried a number of different variations. I figured out the console.log 
thing right as your first email came in. With all my hacks applied and the
ones that you suggested on top it now works.

Next I'll need to carefully one by one back the hacks out to see which
one did the trick. I'm suspecting the shader to be honest...

But given that it's Christmas Eve, I'm not sure exactly when I'll get around
to finishing this :-/

Thanks, Lubomir - as always your help has been exceptionally useful!

/D


More information about the subsurface mailing list