Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Japanese
  4. Shapeオブジェクトのasynchronousプロパティを使用したい
Qt 6.12 LTS is out! See what's new in the release blog

Shapeオブジェクトのasynchronousプロパティを使用したい

Scheduled Pinned Locked Moved Unsolved Japanese
1 Posts 1 Posters 1.7k 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

    Shapeオブジェクトのasynchronousプロパティが上手く適応されなくて困っています。

    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; }
            }
    
        }
    
    }
    

    実行すると、asynchronousが効いていないようでした。

    そこで、main.cppに下記を追記した。

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

    すると、asynchronousの設定が効いた。
    ただ、この設定はソース内全てに反映されてしまう。
    (asynchronousがfalseでも設定が効く。)

    出来れば、オブジェクト毎にasynchronousの有無を設定したいため、
    プロパティでの設定方法はありませんでしょうか。
    ご教授お願いいたします。

    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
    • Unsolved