Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This does not work, page.model.count is 11 (so it's not empty) and printing filePath for each Image works as intended, it displays the file path of the image I want to display, however no image is shown.
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- import Sailfish.Pickers 1.0
- import Qt.labs.folderlistmodel 2.1
- Page {
- id: page
- allowedOrientations: Orientation.All
- property FolderListModel model
- SilicaFlickable {
- id: flickable
- anchors.fill: parent
- clip: true
- SlideshowView {
- id: imageContainer
- clip: true
- width: flickable.width
- height: flickable.height
- model: page.model
- delegate: Image {
- id: theImage
- source: filePath
- fillMode: Image.PreserveAspectFit
- width: imageContainer.width
- cache: false
- clip: true
- asynchronous: true
- }
- }
- PullDownMenu {
- MenuItem {
- text: "Open Folder"
- onClicked: pageStack.push(Qt.resolvedUrl("FileChooser.qml"), {folder: "/home/nemo"})
- }
- }
- ScrollDecorator{}
- }
- }
- //----------------------------------------------------------------------
- // This works it displays 5 images in the SlideshowView, too bad they are all the same image :(
- import QtQuick 2.0
- import Sailfish.Silica 1.0
- import Sailfish.Pickers 1.0
- import Qt.labs.folderlistmodel 2.1
- Page {
- id: page
- allowedOrientations: Orientation.All
- property FolderListModel model
- SilicaFlickable {
- id: flickable
- anchors.fill: parent
- clip: true
- SlideshowView {
- id: imageContainer
- clip: true
- width: flickable.width
- height: flickable.height
- model: 5
- delegate: Image {
- id: theImage
- source: "/home/nemo/whatever_image.jpg"
- fillMode: Image.PreserveAspectFit
- width: imageContainer.width
- cache: false
- clip: true
- asynchronous: true
- }
- }
- PullDownMenu {
- MenuItem {
- text: "Open Folder"
- onClicked: pageStack.push(Qt.resolvedUrl("FileChooser.qml"), {folder: "/home/nemo"})
- }
- }
- ScrollDecorator{}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement