Results 1 to 5 of 5

Thread: how to select and delete for images

  1. #1
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default how to select and delete for images

    hi ,
    i displayed all the images from particular directory using foldermodel….everything is fine ….in this images i want to select particular image and i want to delete this image from my qml gui…how can i do please provide solution….below i attached my code please find it…



    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: ["*.png"]
    folder: "Images"
    }

    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


    MouseArea{
    anchors.fill: parent
    onClicked: {


    //image_click.source="/home/bts-003/Desktop/Images/check_box.png"


    }

    }
    }
    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
    }


    }

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to select and delete for images

    You could filter the image out using a QSortFilterProxyModel exposed from C++ or you could implement a custom model in C++ that would handle the case you need.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to select and delete for images

    Screenshot from 2013-06-26 20:16:01.jpgthank you wysota,
    but i have manage my gui in qml ...here i attached my gui please find it and provide solutions
    Last edited by ganeshgladish; 26th June 2013 at 15:49.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to select and delete for images

    Well, I'm sorry -- if a component is not available in QML, you have to code it in C++.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to select and delete for images

    hi wysota ,
    i read your link QSortFilterProxyModel...i don't know how it will help me....please provide some solutions .....how can i do...thanks in advance

Similar Threads

  1. Replies: 1
    Last Post: 20th January 2011, 10:26
  2. Replies: 1
    Last Post: 16th November 2010, 17:45
  3. Replies: 4
    Last Post: 27th July 2009, 15:45
  4. Replies: 4
    Last Post: 19th February 2009, 11:10
  5. QLineEdit and select
    By GuL in forum Newbie
    Replies: 8
    Last Post: 18th September 2008, 15:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.