Scroll view
-
In the similar way shav have explained earlier. Basically its the delegate which is used as a view.
-
I have tried this but the view is not visible, i have also set the visibility to true
-
Ok. It would be better if you post the code or probably a complete minimal sample.
-
@ApplicationWindow {
id : hola
title: ("SketchIt")
width: 640
height: 480
minimumWidth: mainToolBar .implicitWidth
visible: trueImage{ visible:true source:"C:\\1.jpg" sourceSize.width:hola.width/2 sourceSize.height:hola.height/2 } toolBar: ToolBar{ id : mainToolBar anchors.fill :parent RowLayout{ // width : parent.width ToolButton{ // text : ("main") iconSource: "C:\\Users\\Hassan Adil\\Documents\\sketchIt\\16.png" onClicked: hola.color = "blue" anchors.margins: 4
}
Button{ text : "close" onClicked: hola.close()
}
}
}
SplitView{
anchors.fill: parent
orientation: Qt.Horizontal
}}@
-
The C directory path is correct, but no view
-
What do you mean by no view in this example?
-
View meaning that the image is not visible
-
Ok. Try prepending file:// to source. And you can use "/" as file separator. Qt internally handles it depending upon OS.
@
iconSource: "file://C:/Users/Hassan Adil/Documents/sketchIt/16.png"
@ -
If i write file:/1.jpg which is located in C: it works and the view also works , but is it possible to put space between the images ?
-
Ok. By space, do you mean another path ?
-
No i mean i want to have some distance between the images, to make it look good, can i use borders or something else?
-
Inside the RowLayout you can set spacing.
-
Okay thanks a lot!, and also how can i shift the listview close to the bottom of the window
-
anchor it to the bottom.
-
I have tried to anchor it to the parent but the list view doesn't appear on the screen
-
and who is parent of ListView ?
-
I think the application window is the default parent, I haven't specified
-
How did you anchor it ? Can you post some code ?
-
@import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
ApplicationWindow {
//id:root
title: qsTr("Hello World")
width: 1500
height: 1000
property var imagesListModel: ["file:/original.jpg","file:/11.jpg","file:/test (1).jpg","file:/test (2).jpg","file:/test (3).jpg","file:/test (4).jpg","file:/test (5).jpg"]
Image{
id:main
width: 450
height: 600
source:"file:/test (6).jpg"
anchors.centerIn: parent
}
ListView {
id: imagesList
anchors.fill: parent
spacing:25
orientation: Qt.Vertictal
model: imagesListModel
delegate: Image {
width: 75
height: 100
source: imagesListModel[index]MouseArea { anchors.fill: parent onClicked: {
// main.
console.log("User select '"+imagesListModel[index]+"' image");
}
}
}
}}
@ -
And the image with id should change when the user select the image from the list , how can i do that as well?