Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML artifacts - Android
QtWS25 Last Chance

QML artifacts - Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 3 Posters 798 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • zoolekZ Offline
    zoolekZ Offline
    zoolek
    wrote on last edited by
    #1

    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

    KroMignonK J.HilkJ 2 Replies Last reply
    1
    • zoolekZ zoolek

      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

      KroMignonK Offline
      KroMignonK Offline
      KroMignon
      wrote on last edited by
      #2

      @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?
      • ...

      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

      zoolekZ 1 Reply Last reply
      1
      • zoolekZ zoolek

        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

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        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)


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        0
        • KroMignonK KroMignon

          @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?
          • ...
          zoolekZ Offline
          zoolekZ Offline
          zoolek
          wrote on last edited by
          #4

          @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

          J.HilkJ 1 Reply Last reply
          0
          • zoolekZ zoolek

            @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

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #5

            @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 :)


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            zoolekZ 1 Reply Last reply
            0
            • J.HilkJ J.Hilk

              @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 :)

              zoolekZ Offline
              zoolekZ Offline
              zoolek
              wrote on last edited by
              #6

              @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..

              J.HilkJ 1 Reply Last reply
              0
              • zoolekZ zoolek

                @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..

                J.HilkJ Offline
                J.HilkJ Offline
                J.Hilk
                Moderators
                wrote on last edited by
                #7

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


                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                Q: What's that?
                A: It's blue light.
                Q: What does it do?
                A: It turns blue.

                zoolekZ 2 Replies Last reply
                0
                • J.HilkJ J.Hilk

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

                  zoolekZ Offline
                  zoolekZ Offline
                  zoolek
                  wrote on last edited by
                  #8

                  @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 :)

                  1 Reply Last reply
                  0
                  • J.HilkJ J.Hilk

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

                    zoolekZ Offline
                    zoolekZ Offline
                    zoolek
                    wrote on last edited by
                    #9

                    @J-Hilk

                    Unfortunately, the problem in version 5.12.6 still exists.

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved