Scroll view
-
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
}}@
-
What do you mean by no view in this example?
-
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"
@ -
Ok. By space, do you mean another path ?
-
Inside the RowLayout you can set spacing.
-
anchor it to the bottom.
-
and who is parent of ListView ?
-
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");
}
}
}
}}
@ -
You should anchor ListView to bottom of root I.e ApplicationWindow. Do this in ListView
@
anchors.bottom : root.bottom
@To set Image just assign the string that you get in onClicked to source of main