Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtquickcontrols-nemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
qtquickcontrols-nemo
Commits
4789650d
Commit
4789650d
authored
Jan 28, 2017
by
Chupligin Sergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ListView] start code of ListView component
parent
b7eb4320
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
268 additions
and
1 deletion
+268
-1
ListViewPage.qml
examples/touch/content/ListViewPage.qml
+41
-0
main.qml
examples/touch/main.qml
+4
-0
touch.pro
examples/touch/touch.pro
+3
-0
ListView.qml
src/controls/ListView.qml
+43
-0
ListViewItem.qml
src/controls/ListViewItem.qml
+66
-0
controls.pro
src/controls/controls.pro
+3
-1
listview-icon-arrow.svg
src/controls/images/listview-icon-arrow.svg
+47
-0
listview-icon-template-s.svg
src/controls/images/listview-icon-template-s.svg
+59
-0
qmldir
src/controls/qmldir
+2
-0
No files found.
examples/touch/content/ListViewPage.qml
0 → 100644
View file @
4789650d
import
QtQuick
2.1
import
QtQuick
.
Controls
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Page
{
id
:
listViewPage
headerTools
:
HeaderToolsLayout
{
showBackButton
:
false
;
title
:
"
ListView
"
}
ListModel
{
id
:
animalsModel
ListElement
{
name
:
"
Ant
"
;
size
:
"
Tiny
"
}
ListElement
{
name
:
"
Flea
"
;
size
:
"
Tiny
"
}
ListElement
{
name
:
"
Parrot
"
;
size
:
"
Small
"
}
ListElement
{
name
:
"
Guinea pig
"
;
size
:
"
Small
"
}
ListElement
{
name
:
"
Rat
"
;
size
:
"
Small
"
}
ListElement
{
name
:
"
Butterfly
"
;
size
:
"
Small
"
}
ListElement
{
name
:
"
Dog
"
;
size
:
"
Medium
"
}
ListElement
{
name
:
"
Cat
"
;
size
:
"
Medium
"
}
ListElement
{
name
:
"
Pony
"
;
size
:
"
Medium
"
}
ListElement
{
name
:
"
Koala
"
;
size
:
"
Medium
"
}
ListElement
{
name
:
"
Horse
"
;
size
:
"
Large
"
}
ListElement
{
name
:
"
Tiger
"
;
size
:
"
Large
"
}
ListElement
{
name
:
"
Giraffe
"
;
size
:
"
Large
"
}
ListElement
{
name
:
"
Elephant
"
;
size
:
"
Huge
"
}
ListElement
{
name
:
"
Whale
"
;
size
:
"
Huge
"
}
}
ListView
{
id
:
view
anchors.fill
:
parent
clip
:
true
model
:
animalsModel
delegate
:
ListViewItem
{
label
:
name
;
}
section.property
:
"
size
"
}
}
examples/touch/main.qml
View file @
4789650d
...
@@ -92,6 +92,10 @@ ApplicationWindow {
...
@@ -92,6 +92,10 @@ ApplicationWindow {
title
:
"
Spinner
"
title
:
"
Spinner
"
page
:
"
content/SpinnerPage.qml
"
page
:
"
content/SpinnerPage.qml
"
}
}
ListElement
{
title
:
"
ListView
"
page
:
"
content/ListViewPage.qml
"
}
ListElement
{
ListElement
{
title
:
"
Labels (no orientation locks)
"
title
:
"
Labels (no orientation locks)
"
page
:
"
content/LabelPage.qml
"
page
:
"
content/LabelPage.qml
"
...
...
examples/touch/touch.pro
View file @
4789650d
...
@@ -33,3 +33,6 @@ desktop.path = /usr/share/applications
...
@@ -33,3 +33,6 @@ desktop.path = /usr/share/applications
desktop
.
files
=
glacier
-
gallery
.
desktop
desktop
.
files
=
glacier
-
gallery
.
desktop
INSTALLS
+=
desktop
INSTALLS
+=
desktop
DISTFILES
+=
\
content
/
ListViewPage
.
qml
src/controls/ListView.qml
0 → 100644
View file @
4789650d
import
QtQuick
2.1
import
QtQuick
.
Controls
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
ListView
{
id
:
listView
section.criteria
:
ViewSection
.
FullString
section.delegate
:
Component
{
id
:
sectionHeading
Rectangle
{
width
:
listView
.
width
height
:
44
color
:
"
black
"
Text
{
id
:
sectionText
text
:
section
font.capitalization
:
Font
.
AllUppercase
font.pixelSize
:
20
color
:
"
white
"
anchors
{
left
:
parent
.
left
leftMargin
:
10
verticalCenter
:
parent
.
verticalCenter
}
}
Rectangle
{
id
:
line
height
:
1
color
:
"
white
"
width
:
listView
.
width
-
sectionText
.
width
-
30
anchors
{
left
:
sectionText
.
right
leftMargin
:
10
verticalCenter
:
sectionText
.
verticalCenter
}
}
}
}
}
src/controls/ListViewItem.qml
0 → 100644
View file @
4789650d
import
QtQuick
2.1
import
QtQuick
.
Controls
.
Nemo
1.0
Item
{
id
:
root
width
:
parent
.
width
height
:
88
property
alias
label
:
labelItem
.
text
//property alias description: descriptionItem.text
property
string
icon
:
""
property
string
page
:
""
signal
clicked
Rectangle
{
anchors.fill
:
parent
color
:
"
#11ffffff
"
visible
:
mouse
.
pressed
}
Image
{
id
:
itemIcon
height
:
parent
.
height
-
10
width
:
height
anchors
{
left
:
parent
.
left
leftMargin
:
5
top
:
parent
.
top
topMargin
:
5
}
sourceSize.width
:
width
sourceSize.height
:
height
source
:
(
icon
!=
""
)
?
icon
:
"
images/listview-icon-template-s.svg
"
//visible: (icon != "")
}
Label
{
id
:
labelItem
text
:
modelData
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.left
:
itemIcon
.
right
anchors.leftMargin
:
20
anchors.right
:
arrow
.
left
anchors.rightMargin
:
20
clip
:
true
}
Image
{
id
:
arrow
anchors.right
:
parent
.
right
anchors.rightMargin
:
20
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
images/listview-icon-arrow.svg
"
//visible: (page != "")
}
MouseArea
{
id
:
mouse
anchors.fill
:
parent
onClicked
:
root
.
clicked
()
}
}
src/controls/controls.pro
View file @
4789650d
...
@@ -17,7 +17,9 @@ QML_FILES += \
...
@@ -17,7 +17,9 @@ QML_FILES += \
QueryDialog
.
qml
\
QueryDialog
.
qml
\
Header
.
qml
\
Header
.
qml
\
HeaderToolsLayout
.
qml
\
HeaderToolsLayout
.
qml
\
Slider
.
qml
Slider
.
qml
\
ListView
.
qml
\
ListViewItem
.
qml
OTHER_FILES
+=
qmldir
\
OTHER_FILES
+=
qmldir
\
$$
QML_FILES
$$
QML_FILES
...
...
src/controls/images/listview-icon-arrow.svg
0 → 100644
View file @
4789650d
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
version=
"1.1"
id=
"svg5140"
viewBox=
"0 0 32 32.000001"
height=
"32"
width=
"32"
>
<defs
id=
"defs5142"
>
<linearGradient
id=
"linearGradient3919-7-9"
>
<stop
id=
"stop3921-4-3"
offset=
"0"
style=
"stop-color:#ffffff;stop-opacity:1;"
/>
<stop
id=
"stop3923-0-19"
offset=
"1"
style=
"stop-color:#dcdcdc;stop-opacity:1;"
/>
</linearGradient>
</defs>
<metadata
id=
"metadata5145"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform=
"translate(0,-1020.3622)"
id=
"layer1"
>
<path
id=
"path5357-0-0"
d=
"m 6.5000002,1025.3622 0,22 18.9999998,-10 0,-2 z"
style=
"display:inline;fill:#ffffff;fill-opacity:1;stroke:none"
/>
</g>
</svg>
src/controls/images/listview-icon-template-s.svg
0 → 100644
View file @
4789650d
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
version=
"1.1"
id=
"svg5140"
viewBox=
"0 0 32 32.000001"
height=
"32"
width=
"32"
>
<defs
id=
"defs5142"
>
<linearGradient
xlink:href=
"#linearGradient3919-7-9"
id=
"linearGradient4206-77"
gradientUnits=
"userSpaceOnUse"
x1=
"-426.48438"
y1=
"125.01562"
x2=
"-426.48438"
y2=
"187.98438"
gradientTransform=
"matrix(0.49230769,0,0,0.49230769,226.46155,959.31607)"
/>
<linearGradient
id=
"linearGradient3919-7-9"
>
<stop
id=
"stop3921-4-3"
offset=
"0"
style=
"stop-color:#ffffff;stop-opacity:1;"
/>
<stop
id=
"stop3923-0-19"
offset=
"1"
style=
"stop-color:#dcdcdc;stop-opacity:1;"
/>
</linearGradient>
</defs>
<metadata
id=
"metadata5145"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform=
"translate(0,-1020.3622)"
id=
"layer1"
>
<circle
id=
"path4010-94-3"
style=
"display:inline;fill:url(#linearGradient4206-77);fill-opacity:1;stroke:none"
cx=
"16"
cy=
"1036.3622"
r=
"16"
/>
</g>
</svg>
src/controls/qmldir
View file @
4789650d
...
@@ -19,6 +19,8 @@ QueryDialog 1.0 QueryDialog.qml
...
@@ -19,6 +19,8 @@ QueryDialog 1.0 QueryDialog.qml
Header 1.0 Header.qml
Header 1.0 Header.qml
HeaderToolsLayout 1.0 HeaderToolsLayout.qml
HeaderToolsLayout 1.0 HeaderToolsLayout.qml
Slider 1.0 Slider.qml
Slider 1.0 Slider.qml
ListView 1.0 ListView.qml
ListViewItem 1.0 ListViewItem.qml
# MIRRORED CONTROLS:
# MIRRORED CONTROLS:
# These are the controls that we take directly from official QQC.
# These are the controls that we take directly from official QQC.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment