PDA

View Full Version : image_deleted



ganeshgladish
3rd July 2013, 13:39
hai everyone,

i have created gui in this gui i displayed images using listview....now my doubt is i want to select image and delete...i dont know how can i do...please tell me ....here i attached my code please check it....



import QtQuick 2.0
import Qt.labs.folderlistmodel 1.0


Rectangle {
id:root
width: 360
height: 360



//================ BUTTON : press = remove the selection
Rectangle {
id:button
width: 360
height: 100
color: buttonArea.pressed ? "gray" : "lightgray"
Text {
anchors.centerIn: parent
text:"click to delete selection"
}
MouseArea{
id:buttonArea
anchors.fill: parent
onPressed: root.removeSelection()
}
}


Rectangle{
width: parent.width-200
height: parent.height/3.6
anchors.bottom: parent.bottom
color: "transparent"
anchors.horizontalCenter: parent.horizontalCenter

ListView {
id:list_view_rm
anchors.fill: parent
width: 400; height: 600
clip: true


orientation: "Horizontal"

FolderListModel {
id: folderModel
nameFilters: ["*"]
folder: "image"

}



Component {
id: fileDelegate

Column {
Rectangle{
id:sss
width: 250; height: 160
border.color: "white"
border.width: 2
color:"transparent"


Image {
id:image_click
anchors.fill: parent
//anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width; height: parent.height
fillMode:Image.PreserveAspectFit
smooth: true
source:folderModel.folder + "/" + fileName

}
Text { text: fileName
anchors.bottom: parent.bottom
// anchors.leftMargin: 20
anchors.horizontalCenter: parent.horizontalCenter
color: "white"
font.bold: true
}
}
}

}
highlight: Rectangle { color: "lightsteelblue"; radius: 5 }

model: folderModel
delegate: fileDelegate
}


}


}

ChrisW67
3rd July 2013, 22:23
Please stop creating new threads to ask the same question hoping for someone to supply a cut-n-paste answer.
http://www.qtcentre.org/threads/55220-floderview
http://www.qtcentre.org/threads/55139-how-to-select-and-delete-for-images
http://www.qtcentre.org/threads/55098-listview

Put some of that effort into trying to help yourself by reading the docs, trying things for yourself, and if all else fails ask a targetted, intelligent question.

If your question post does not address these things it is probably lacking something and reduces your chance of a quick resolution:
The Qt version and features you are using: C++, QtQuick 1 or 2, QtWebKit, QtNetwork etc.
The platform: Windows 7, Linux, Mac OS X , etc.
What you were expecting to see from your program
What you actually saw and why you think that is a problem
Any pertinent compiler, linker, or runtime error or warning message and the matching region of source as required
What you have investigated to resolve the problem: code snippets, docs read, examples used etc.
An intelligent, targetted question rather than a plea to "send me some solution" or "check my code"
Read the replies and use the same thread to keep working the problem.

BTW: You have been here long enough to know to use