Hi all,
I am having problems using PathView image browser for gallery images (I am
trying to create a carousel using QML).
Here is a version of the code I am using. It works well for small images but
for larger images the performance is really poor.
Is there any way to create a model using smaller images created from the
gallery model? (I could dive into C++ but this is something I am trying to
avoid as an experiment).
Any other improvements to the code would also be appreciated,
Regards,
Ronan.
-----------------------------------------------------------------------------------------------------------------------------------
import QtQuick 1.0
import QtMobility.gallery 1.1
Rectangle {
id: rootWindow
Rectangle {
id: mainPage
anchors.fill: parent
DocumentGalleryModel {
id: galleryModel
rootType : DocumentGallery.Image
properties : [ "url" ]
filter : GalleryWildcardFilter {
property : "fileName";
value : "*.jpg";
}
}
Component {
id: appDelegate
Item {
width: parent.width/2
height: parent.height/2
scale: PathView.iconScale
z: PathView.height
Image {
anchors.horizontalCenter: parent.horizontalCenter
source: url
width: parent.width
height: parent.height
smooth: false
}
transform: Rotation {
origin.x :width/2
origin.y :height/2
axis {
x: 0
y: 1
z: 0
}
angle: PathView.rotation
}
}
}
Component {
id: appHighlight
Rectangle {
width: parent.width/2 + 10
height: parent.height/2 + 10
color: "lightsteelblue"
}
}
PathView {
id: view
anchors.fill: parent
focus: true
model: galleryModel
delegate : appDelegate
pathItemCount: 7
interactive: true
highlight: appHighlight
highlightMoveDuration: 100
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
property int xcenter: Math.round( parent.width/2 )
property int ycenter: Math.round( parent.height/2 )
property int xsize: parent.width
path: Path {
startX: 0
startY: view.ycenter
PathAttribute { name: "iconScale"; value: 0.4 }
PathAttribute { name: "rotation"; value: 90 }
PathAttribute { name: "height"; value: -10 }
PathLine { x: view.xcenter; y: view.ycenter }
PathAttribute { name: "iconScale"; value: 1.0 }
PathAttribute { name: "rotation"; value: 0 }
PathAttribute { name: "height"; value: 0 }
PathLine { x: view.xsize; y: view.ycenter }
PathAttribute { name: "iconScale"; value: 0.4 }
PathAttribute { name: "rotation"; value: -90 }
PathAttribute { name: "height"; value: -10 }
}
}
}
}
-------------------------------------------------------------------------------------------------------------
____________________________________________________________________________
Ronan Mac Laverty
MeeGo Developer Advocate, Nokia
Helsinki, Finland
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml