Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QML artifacts - Android



  • Hi all,
    This is my first post, so thank you for your understanding.

    I am writing an android application and I have a problem with appearing artifacts on Image elements. Have any of you encountered such a problem?
    I have searched many Google pages but unfortunately I have not found the answer.

    Qt version: 5.12.5, but the same problem also occurs in version 5.12.4, 5.12.3
    It doesn't matter what the android version is. Problem available on versions 6,7,8 and 9.

    Thank you in advance for any help.

    ar2.png ar1.png



  • @zoolek Hello and welcome to the forum. To be honest, I don't really understand what you want to tell us :(
    Can you give more details what the problem is?

    • What is the expected result and the reel result.
    • How you construct the view: QML? C++?
    • Are you using PNG, SVG?
    • ...

  • Moderators

    hi @zoolek and welcome,

    additionally to what @KroMignon said, can you show us, how you actually draw /show the problematic items (code)

    Also, I would try to check out 5.12.6 there were quite a lot of bugs in the version 4 & 5 (recessions even)



  • @KroMignon @J-Hilk

    I use images in png format. My problem is that these paintings have artifacts.

    For example for dots:

    Image {
                            id: delegateDotsImage
                            width: 20
                            height: 20
                            smooth: true
                            antialiasing: true
                            x: parent.width - width + 5
                            anchors.verticalCenter: parent.verticalCenter
                            source: "icons/dots.png"
                            opacity: delegateDotsMouseArea.pressed ? 0.4 : 1.0
                            clip: true
                           
                            ColorOverlay {
                                anchors.fill: parent
                                source: delegateDotsImage
                                color: "black"
                            }
    

    main.cpp

        QQmlApplicationEngine engine;
        NotificationClient *notificationClient = new NotificationClient(&engine);
        engine.rootContext()->setContextProperty(QLatin1String("notificationClient"),
                                                 notificationClient);
    
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                         &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl)
                QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        engine.load(url);
    

    The rest of the application is written in QML.

    Screenshot_20191122-090258_fitworkout.pl.png Screenshot_20191122-090240_fitworkout.pl.png


  • Moderators

    @zoolek
    I don't have an android device here to test, but I think, the issue is either the opacity or (more likely) the ColorOverlay.

    You could check if, when you turn one or both off, that helps?

    If yes, I'm sure we'll find a way do get your desired results :)



  • @J-Hilk

    Without ColorOverlay is ok.

    In addition (with ColorOverlay), I tried to add the following code on an older device with android 6:

    static QSurfaceFormat createSurfaceFormat() {
        QSurfaceFormat format;
        format.setSamples(4);
        format.setDepthBufferSize(24);
        format.setStencilBufferSize(8);
        format.setVersion(2, 0);
        return format;
    }
    

    and there were no problems. On higher versions, for example android 7 - the application crashes at random moments. Overall, I think this is a rendering problem when using ColorOverlay. But ColorOverlay is useful..


  • Moderators

    @zoolek
    have you tried with 5.12.6?
    and what import do you use for QtGraphicalEffects?



  • @J-Hilk

    import QtGraphicalEffects 1.12
    

    I will check on version 5.12.6 and write what the result is. I need to download and install first :)



  • @J-Hilk

    Unfortunately, the problem in version 5.12.6 still exists.


Log in to reply