Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Shape Path Translucent Overdraw Problem (GL specific?)
QtWS25 Last Chance

Shape Path Translucent Overdraw Problem (GL specific?)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 191 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.
  • matthew.kuiashM Offline
    matthew.kuiashM Offline
    matthew.kuiash
    wrote on last edited by
    #1

    Hi everybody. Long time no post - long story.

    I've got stuck with what I think seems to be a triangle overdraw problem with shapes.

    Firstly - Qt 5.11 on MacOS 10.13.4. iMac 5K later 2014. Also observed on iPad Pro.

    Secondly here's the code.

    // (C) kindid.co.uk 2018
    
    import QtQuick 2.10
    import QtQuick.Window 2.10
    import QtQuick.Shapes 1.11
    
    Window {
        id: root
        visible: true
        width: 320
        height: 320
        title: qsTr("KD Button Test")
        Shape {
            id: shape
            property int radius: 40
            anchors.fill: parent
            anchors.margins: 20
            ShapePath {
                strokeWidth: 30
                strokeColor: Qt.rgba(0.5,0.5,1,0.5)
                fillColor: Qt.rgba(0,0,1,1)
                startX: shape.radius
                startY: 0
                PathArc {
                    x: 0
                    y: shape.radius
                    radiusX: shape.radius
                    radiusY: shape.radius
                    direction: PathArc.Counterclockwise
                }
                PathLine {
                    x: 0
                    y: shape.height - shape.radius
                }
                PathArc {
                    x: shape.radius
                    y: shape.height
                    radiusX: shape.radius
                    radiusY: shape.radius
                    direction: PathArc.Counterclockwise
                }
                PathLine {
                    x: shape.width - shape.radius
                    y: shape.height
                }
                PathArc {
                    x: shape.width
                    y: shape.height - shape.radius
                    radiusX: shape.radius
                    radiusY: shape.radius
                    direction: PathArc.Counterclockwise
                }
                PathLine {
                    x: shape.width
                    y: shape.radius
                }
                PathArc {
                    x: shape.width - shape.radius
                    y: 0
                    radiusX: shape.radius
                    radiusY: shape.radius
                    direction: PathArc.Counterclockwise
                }
                PathLine {
                    x: shape.radius
                    y: 0
                }
            }
        }
    }
    

    Thirdly - Here's what that renders - notice the glitches where the arcs and lines meet. My supposition is that those pixels are being drawn twice - hence the colour is wrong - it's been blended with itself as it were. I found similar things in my own renderers before.
    0_1540540122784_opengl_glitch.png
    Setting QT_QUICK_BACKEND to "software" and running again I get a correct result (however, this is not really and option for me)
    0_1540540305495_software_no_glitch.png
    Any pointers?

    The legendary cellist Pablo Casals was asked why he continued to practice at age 90. "Because I think I'm making progress," he replied.

    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