한국어
 

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 Qt Wifi 기능 관련 문의 [3] banbol 2020.03.05 14042
24 QOpenGLFramebufferObject 에 대해 질문 드립니다. [2] 민토고 2021.04.23 7803
23 c++에서 qml id를 획득하는 방법 [2] LISP 2021.06.03 1496
22 Qml 파일 c++ 라이브러리을 헤더파일에 추가 방법 file 플랑크 2021.11.01 1005
21 qml에서 cpp객체의 함수호출시 js함수를 콜백으로 넘기는 방법 [1] 데브스카이 2022.12.05 990
20 qtquick.Controls 1.x Label 사용 이유 [1] 플랑크 2021.10.20 660
19 GridView 안에 Scrollbar System 2022.02.23 412
18 QT관련 질문드립니다. [10] file 김상연 2021.03.28 394
17 Qt lgpl 라이센스 문의 [3] banbol 2021.08.30 281
16 Qt 데이터 주고받기 관련 문의 [3] 인기아이템 2020.04.26 259
15 외주할 때 어디서 하세요? 커피모카 2022.06.28 248
14 코린이 QML 관련 질문 [2] 플랑크 2021.10.08 248
13 커스텀 위젯 promote 방법 [2] LISP 2021.06.23 220
12 파이썬으로 GUI 프로그래밍 질문 [2] LISP 2021.05.25 192
11 한글에서 c언어로 번역하는 프로그램이나 홈페이지는 없을까요? [1] 에몽이 2020.06.16 188
10 QML Swipeview에서 loader의 사용방법 문의 [1] banbol 2021.05.24 187
9 Qt ListView 테이블 간격? 조절 [2] file System 2021.06.21 176
8 vmware ubuntu20.04 급한 질문입니다 ㅠㅠ file dotrim 2021.04.16 162
7 Qt 안드로이드 빌드 시 QtSerialPort로 USB to Serial 디바이스에 접근할 수 없나요? [2] 쿼카 2021.05.31 156
6 Qt wayland와 eglfs 플랫폼 문의 [2] banbol 2021.07.28 140