- 
    
Bug
 - 
    Resolution: Done
 - 
    
P2: Important
 - 
    4.7.4
 - 
    None
 - 
    Qt 4.7.4
Qt Creator 2.3.0
Based on Qt 4.7.4 (32 bit)
Built on Aug 25 2011 at 15:26:28
From revision 0c9dc89d0b
 
Case 1: current item is seen but not centered
Steps:
1. create QML Application from template
2. Add a ListModel
3. Add a PathView into it and set the path, preferredHighlightBegin and preferredHighlightEnd as follows
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
delegate: Rectangle {
	width: 100
	height: 100
	color: (PathView.isCurrentItem?"red":(index%2==0?"black":"yellow"))
	border.color: (index%2==0?"orange":"blue")
	border.width: 2
	Text {
		text: myString
		anchors.centerIn: parent
		color: (index%2==0?"white":"black")
	}
	z: (PathView.isCurrentItem?1:0)
}
path: Path {
	id: path
	startX: -100+pathView.width/2
	startY: pathView.height/2
	PathLine {
		id: line
		x: 100+pathView.width/2
		y: pathView.height/2
	}
}
4. Compile and run the application. In the application,
5. Add 3 items to the PathView's model.
-> The item which was inserted first is current item [OK], but it is not in the center! [Not OK]
6. Click anywhere on the PathView
-> Now the inserted which was inserted last is suddenly made the current item [Not OK]
Bug is obtained also when the pathItemCount is set.
Case 2: current item is not ultimately even seen
Steps:
1. Do steps 1-3 from the case 1, but in this time, set pathItemCount to N (e.g., N=2).
2. Add X >= N items items.
3. Change the item at index 0 to be the current.
4. Add items.
-> Now the current item's position is floating right all the time ultimately not be shown in path!
See the attachment PathViewBugReport.zip of QTBUG-21315 for example code (for the case 2, add line "pathItemCount: 2" to the PathView element).