Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
QT QML循环和文本列表视图_Qt_Listview_Qml - Fatal编程技术网

QT QML循环和文本列表视图

QT QML循环和文本列表视图,qt,listview,qml,Qt,Listview,Qml,我想创建一个类似于下图的UI。我知道Qt Pathview可以帮助我以循环方式移动项目。但是我不知道如何在文本之间创建与图像相似的背景。我尝试使用矩形半径:360绘制圆,但pathview项不会沿矩形圆的中心移动 也许这个简单的例子可以帮助您使用PathView: 你的解释不清楚。请展示你在图片中的意思。请澄清你的问题。正如@SoheilArmin已经说过的,请提供你想要的清晰图像,一些草图或其他东西。请提供您尝试这样做的情况以及您得到的结果。 import QtQuick 2.12 impo

我想创建一个类似于下图的UI。我知道Qt Pathview可以帮助我以循环方式移动项目。但是我不知道如何在文本之间创建与图像相似的背景。我尝试使用矩形半径:360绘制圆,但pathview项不会沿矩形圆的中心移动


也许这个简单的例子可以帮助您使用PathView:


你的解释不清楚。请展示你在图片中的意思。请澄清你的问题。正如@SoheilArmin已经说过的,请提供你想要的清晰图像,一些草图或其他东西。请提供您尝试这样做的情况以及您得到的结果。
import QtQuick 2.12
import QtQuick.Window 2.12

Window {
    visible: true
    width: 400
    height: 400

    Item {
        id: container
        width: 300
        height: 300
        anchors.centerIn: parent
        Rectangle {
            anchors.fill: parent
            radius: width /2
            color: "orange"
            Rectangle {
                x: 50
                y: 50
                width: 200
                height: 200
                radius: 100
                color: "white"
            }
        }

        PathView {
            anchors.fill: parent
            model: 10
            delegate: Rectangle {
                width: 50
                height: 50
                radius: 25
                color: "green"
            }
            path: Path {
                startX: 150; startY: 25

                PathArc {
                    x: 150; y: 275
                    radiusX: 125; radiusY: 125
                    direction: PathArc.Clockwise

                }
                PathArc {
                    x: 150; y: 25
                    radiusX: 125; radiusY: 125
                    direction: PathArc.Clockwise

                }
            }
        }
    }
}