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. I want to use the asynchronous property of a Shape object
Forum Updated to NodeBB v4.3 + New Features

I want to use the asynchronous property of a Shape object

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 166 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.
  • R Offline
    R Offline
    Ren.K
    wrote on last edited by
    #1

    I'm having trouble adapting the asynchronous property of a Shape object.

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Shapes 1.15
    
    Window {
        width: 300
        height: 300
        visible: true
        title: qsTr("Hello World")
    
        Shape {
            id: myShape
            anchors.fill: parent
            asynchronous: true
    
            ShapePath {
                id: myShapePath
                strokeWidth: 5
                strokeColor: "#00ff00"
                fillColor: "#00aa00"
                startX: 20
                startY: 20
                PathLine { x: 60; y: 150; }
                PathLine { x: 200; y: 200; }
                PathLine { x: 40; y: 250; }
                PathLine { x: 20; y: 20; }
            }
        }
    }
    

    When I run it, asynchronous is not working.

    Therefore, I added the following to main.cpp.

        QSurfaceFormat format;
        format.setSamples(8);
        QSurfaceFormat::setDefaultFormat(format);
    

    Then, the asynchronous setting worked.
    However, this setting will be reflected in everything in the source.
    (The setting works even if asynchronous is false.)

    If possible, I want to set the presence or absence of asynchronous for each object, so
    Is there a way to set it in the property?

    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