Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure items in ListView and GridViews viewport are visible.
Unrequested items and items in the cache buffer are hidden by the views. Make these items visible again if they enter the viewport due to a relayout. Change-Id: I574d1513e88c31c3c01a4a20ac77c21111279d3e Reviewed-by: Bea Lam <bea.lam@nokia.com>
- Loading branch information
Andrew den Exter
authored and
Qt by Nokia
committed
Dec 20, 2011
1 parent
f3c7d8c
commit ac50bb1
Showing
7 changed files
with
488 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
tests/auto/qtquick2/qquickgridview/data/unrequestedItems.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
width: 240 | ||
height: 320 | ||
|
||
Component { | ||
id: myDelegate | ||
|
||
Package { | ||
Rectangle { | ||
id: leftWrapper | ||
objectName: "wrapper" | ||
Package.name: "left" | ||
height: 80 | ||
width: 60 | ||
Text { | ||
text: index | ||
} | ||
color: ListView.isCurrentItem ? "lightsteelblue" : "white" | ||
} | ||
Rectangle { | ||
id: rightWrapper | ||
objectName: "wrapper" | ||
Package.name: "right" | ||
height: 80 | ||
width: 60 | ||
Text { | ||
text: index | ||
} | ||
color: ListView.isCurrentItem ? "lightsteelblue" : "white" | ||
} | ||
} | ||
|
||
} | ||
|
||
VisualDataModel { | ||
id: visualModel | ||
|
||
delegate: myDelegate | ||
model: testModel | ||
} | ||
|
||
GridView { | ||
id: leftList | ||
objectName: "leftGrid" | ||
anchors { | ||
left: parent.left; top: parent.top; | ||
right: parent.horizontalCenter; bottom: parent.bottom | ||
} | ||
model: visualModel.parts.left | ||
cellWidth: 60 | ||
cellHeight: 80 | ||
} | ||
|
||
GridView { | ||
id: rightList | ||
objectName: "rightGrid" | ||
anchors { | ||
left: parent.horizontalCenter; top: parent.top; | ||
right: parent.right; bottom: parent.bottom | ||
} | ||
model: visualModel.parts.right | ||
cellWidth: 60 | ||
cellHeight: 80 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
tests/auto/qtquick2/qquicklistview/data/unrequestedItems.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
width: 240 | ||
height: 320 | ||
|
||
Component { | ||
id: myDelegate | ||
|
||
Package { | ||
Rectangle { | ||
id: leftWrapper | ||
objectName: "wrapper" | ||
Package.name: "left" | ||
height: 20 | ||
width: 120 | ||
Text { | ||
text: index | ||
} | ||
color: ListView.isCurrentItem ? "lightsteelblue" : "white" | ||
} | ||
Rectangle { | ||
id: rightWrapper | ||
objectName: "wrapper" | ||
Package.name: "right" | ||
height: 20 | ||
width: 120 | ||
Text { | ||
text: index | ||
} | ||
color: ListView.isCurrentItem ? "lightsteelblue" : "white" | ||
} | ||
} | ||
|
||
} | ||
|
||
VisualDataModel { | ||
id: visualModel | ||
|
||
delegate: myDelegate | ||
model: testModel | ||
} | ||
|
||
ListView { | ||
id: leftList | ||
objectName: "leftList" | ||
anchors { | ||
left: parent.left; top: parent.top; | ||
right: parent.horizontalCenter; bottom: parent.bottom | ||
} | ||
model: visualModel.parts.left | ||
} | ||
|
||
ListView { | ||
id: rightList | ||
objectName: "rightList" | ||
anchors { | ||
left: parent.horizontalCenter; top: parent.top; | ||
right: parent.right; bottom: parent.bottom | ||
} | ||
model: visualModel.parts.right | ||
} | ||
} |
Oops, something went wrong.