black squares instead of icons

Lubomir I. Ivanov neolit123 at gmail.com
Thu Dec 24 15:41:37 PST 2015


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.

lubomir
--


More information about the subsurface mailing list