aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels/doc/snippets/qml/tablemodel/fruit-example-simpledelegate.qml
blob: f51c1818c3854f100b7002fdf267bfc79fdab8ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** BSD License Usage
** Alternatively, you may use this file under the terms of the BSD license
** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
**   * Redistributions of source code must retain the above copyright
**     notice, this list of conditions and the following disclaimer.
**   * Redistributions in binary form must reproduce the above copyright
**     notice, this list of conditions and the following disclaimer in
**     the documentation and/or other materials provided with the
**     distribution.
**   * Neither the name of The Qt Company Ltd nor the names of its
**     contributors may be used to endorse or promote products derived
**     from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/

//![file]
import QtQuick 2.12
import QtQuick.Window 2.12
import Qt.labs.qmlmodels 1.0

Window {
    width: 400
    height: 400
    visible: true

    TableView {
        anchors.fill: parent
        columnSpacing: 1
        rowSpacing: 1
        boundsBehavior: Flickable.StopAtBounds

        model: TableModel {
            TableModelColumn { display: "checked" }
            TableModelColumn { display: "amount" }
            TableModelColumn { display: "fruitType" }
            TableModelColumn { display: "fruitName" }
            TableModelColumn { display: "fruitPrice" }

            // Each row is one type of fruit that can be ordered
//![rows]
            rows: [
                {
                    // Each property is one cell/column.
                    checked: false,
                    amount: 1,
                    fruitType: "Apple",
                    fruitName: "Granny Smith",
                    fruitPrice: 1.50
                },
                {
                    checked: true,
                    amount: 4,
                    fruitType: "Orange",
                    fruitName: "Navel",
                    fruitPrice: 2.50
                },
                {
                    checked: false,
                    amount: 1,
                    fruitType: "Banana",
                    fruitName: "Cavendish",
                    fruitPrice: 3.50
                }
            ]
//![rows]
        }
//![delegate]
        delegate:  TextInput {
            text: model.display
            padding: 12
            selectByMouse: true

            onAccepted: model.display = text

            Rectangle {
                anchors.fill: parent
                color: "#efefef"
                z: -1
            }
        }
//![delegate]
    }
}
//![file]
-allow-running-tests-without-installing-first Vendor branches of https://github.com/llvm/llvm-project.git
summaryrefslogtreecommitdiffstats
path: root/libcxx
Commit message (Expand)AuthorAgeFilesLines
* Move the feature test macros script to the utils directory.Eric Fiselier2019-02-022-13/+15
* Handle cases where the dirent::d_type macros aren't definedEric Fiselier2019-02-011-0/+3
* add a test and a couple minor bug fixes for the implicit-signed-integer-trunc...Marshall Clow2019-02-013-2/+7
* [libc++] Disentangle the 3 implementations of type_infoLouis Dionne2019-02-011-31/+75
* Fix a bit of libc++-specific behavior in the regex tests; add a missing test....Marshall Clow2019-01-313-4/+46
* [CMake] Use correct visibility for linked libraries in CMakePetr Hosek2019-01-302-2/+8
* Revert "[CMake] Use correct visibility for linked libraries in CMake"Petr Hosek2019-01-301-2/+2
* [CMake] Use correct visibility for linked libraries in CMakePetr Hosek2019-01-301-2/+2
* [libc++] Explicitly initialize std::nothrowThomas Anderson2019-01-301-1/+1
* [libc++] Don't define operator new/delete when using vcruntimeThomas Anderson2019-01-301-7/+8
* [libc++] Don't define exception destructors when using vcruntimeThomas Anderson2019-01-301-15/+8
* [libc++] Fix Windows build error in <functional>Thomas Anderson2019-01-292-5/+7
* [libc++] Fix Windows build error in include/filesystemThomas Anderson2019-01-291-1/+0
* Fix PR40495 - is_invokable_v<void> does not compileEric Fiselier2019-01-293-199/+376
* Adjust documentation for git migration.James Y Knight2019-01-2914-62/+24
* [NFC] Add missing revision for removal of bad_array_length in ABI changelogLouis Dionne2019-01-291-1/+1
* Mark some of the behavior in the move w/allocator constructors of deque/unord...Marshall Clow2019-01-295-36/+41
* [libc++] Use runtime rather then compile-time glibc version checkPetr Hosek2019-01-281-10/+24
* Revert "[CMake] Use __libc_start_main rather than fopen when checking for C l...Petr Hosek2019-01-281-1/+1
* [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT alwaysMichal Gorny2019-01-281-1/+1
* [CMake] Use __libc_start_main rather than fopen when checking for C libraryPetr Hosek2019-01-281-1/+1
* update upcoming meeting issue statusEric Fiselier2019-01-281-1/+1
* Mark awk.pass.cpp as XFAIL for NetBSDKamil Rytarowski2019-01-241-1/+2
* D14686: 'Protect against overloaded comma in random_shuffle and improve tests...Marshall Clow2019-01-243-4/+47
* [libcxx] Portability fix: unordered_set and unordered_multiset iterators are ...Louis Dionne2019-01-241-4/+4
* Mark another test as flakyKamil Rytarowski2019-01-241-0/+2
* Change a couple of '&' to addressof(). NFCMarshall Clow2019-01-241-3/+3
* Uncomment the entire test, but mark as XFAIL on linux-gnu because it uses loc...Marshall Clow2019-01-241-2/+3
* Mark another test as flakyKamil Rytarowski2019-01-231-0/+2
* Apply D28248: 'Work around GCC PR37804'. Thanks to mdaniels for the patchMarshall Clow2019-01-233-0/+49
* [test] Define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST in msvc_stdlib_force_in...Casey Carter2019-01-231-3/+7
* Mark another test as flakyKamil Rytarowski2019-01-231-0/+2
* Correct mark for flaky testsKamil Rytarowski2019-01-237-7/+7
* Commit D11348: 'Win32 support: wcsnrtombs and mbsnrtowcs don't handle null ou...Marshall Clow2019-01-231-0/+10
* Mark more tests flakyKamil Rytarowski2019-01-232-0/+4
* Mark thread.condition.condvarany/wait_for.pass.cpp as flakyKamil Rytarowski2019-01-231-0/+2
* While reviewing D57058, Louis had some questions about the existing span cons...Marshall Clow2019-01-222-36/+69
* [libcxx] Include <cstring> in tests that use strcmpLouis Dionne2019-01-224-5/+8
* Note that we have a patch for LWG3101Marshall Clow2019-01-221-2/+2
* Updated issue 3144Marshall Clow2019-01-221-2/+2
* Update with issues to be moved in San DiegoMarshall Clow2019-01-221-67/+32
* Fix typos throughout the license files that somehow I and my reviewersChandler Carruth2019-01-211-1/+1
* Fix aligned allocation availability XFAILs after D56445.Eric Fiselier2019-01-208-24/+40
* Revert "Fix aligned allocation availability XFAILs after D56445."Eric Fiselier2019-01-208-24/+16
* Improve docker images and configuration; create compiler-zoo imageEric Fiselier2019-01-199-365/+395
* Update an example to use the new LLVM file header.Chandler Carruth2019-01-191-8/+6
* Update generator script to use the new license file header.Chandler Carruth2019-01-191-4/+3
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-19