한국어
 

ListView Repeater 질문 !

System 2021.07.06 17:24 조회 수 : 103

안녕하세요. ListView Repeater 에 관련해 궁금한 것이 있어 질문을 남깁니다. 

 

Row를 가변으로 만들고, 그 가변 정보에 model 데이터를 넣고 싶어 질문을 드립니다. 

 

 

    ListModel {
        id:ref
        ListElement {
            name: "Bill Smith"
            number: "555 3264"

              cost : 1

        }
        ListElement {
            name: "John Brown"
            number: "555 8426"

              cost : 1

        }
        ListElement {
            name: "Sam Wise"
            number: "555 0473"

              cost : 1

        }

 

    }

 

    ListView {
        anchors.fill: parent
        model: ref
        delegate: Rectangle{
            id : del
            width: parent.width
            height: 100
            Row{
                Repeater{
                    model : 3;
                    Rectangle{
                        width:100 ; height : 40
                        border.width: 1
                        color:"yellow"
                        Text {
                            anchors.centerIn: parent
                            text: ref.get(index) ......
                        }
                    }
            }
            }
        }

 
        highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
        focus: true

 

    }

 

구조는 위와같은 형식으로 되어 있으며

Repeater 안에 

Rectangle 데이터를 모델의 name, number , cost 등을 순차적으로 넣고싶은데,
혹시 방법이 있을까요? 

 

 

번호 제목 글쓴이 날짜 조회 수
25 qml에서 cpp객체의 함수호출시 js함수를 콜백으로 넘기는 방법 [1] 데브스카이 2022.12.05 991
24 외주할 때 어디서 하세요? 커피모카 2022.06.28 248
23 GridView 안에 Scrollbar System 2022.02.23 412
22 Qml 파일 c++ 라이브러리을 헤더파일에 추가 방법 file 플랑크 2021.11.01 1005
21 qtquick.Controls 1.x Label 사용 이유 [1] 플랑크 2021.10.20 660
20 1인개발자입니다. 앱을 개발해 보려고 하는데 도와주세요..ㅠㅠ prove 2021.10.10 132
19 코린이 QML 관련 질문 [2] 플랑크 2021.10.08 248
18 Qt lgpl 라이센스 문의 [3] banbol 2021.08.30 282
17 Qt wayland와 eglfs 플랫폼 문의 [2] banbol 2021.07.28 140
» ListView Repeater 질문 ! [1] System 2021.07.06 103
15 커스텀 위젯 promote 방법 [2] LISP 2021.06.23 221
14 Qt ListView 테이블 간격? 조절 [2] file System 2021.06.21 176
13 다른 ui에서 버튼을 클릭하면 main ui로 전송 [1] LISP 2021.06.17 121
12 c++에서 qml id를 획득하는 방법 [2] LISP 2021.06.03 1496
11 Qt 안드로이드 빌드 시 QtSerialPort로 USB to Serial 디바이스에 접근할 수 없나요? [2] 쿼카 2021.05.31 156
10 StackView 에서 ID 상호 호환?이 가능한가요 [2] LISP 2021.05.29 107
9 파이썬으로 GUI 프로그래밍 질문 [2] LISP 2021.05.25 192
8 QML Swipeview에서 loader의 사용방법 문의 [1] banbol 2021.05.24 187
7 QOpenGLFramebufferObject 에 대해 질문 드립니다. [2] 민토고 2021.04.23 7803
6 vmware ubuntu20.04 급한 질문입니다 ㅠㅠ file dotrim 2021.04.16 162