Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to select and delete for images
QtWS25 Last Chance

How to select and delete for images

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ganeshgladish
    wrote on last edited by
    #1

    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: {
                               }
    
                           }
                       }
                       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
           }
    
    
       }@
    
    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      first of all you should surround your code with code tags ('@') ... i doubt that anybody wants to do the extra work in reading this big block of text and figure out what it actually does...

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • G Offline
        G Offline
        ganeshgladish
        wrote on last edited by
        #3

        thanks you for your comments,
        sorry, if i want select group of images and delete

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SergioDanielG
          wrote on last edited by
          #4

          Hi ganeshgladish.
          Did you try using "QFile::remove()":http://qt-project.org/doc/qt-5.0/qtcore/qfile.html#remove ?
          Regards.

          www.ftatv.com.ar El foro argentino de la TV libre

          1 Reply Last reply
          0
          • G Offline
            G Offline
            ganeshgladish
            wrote on last edited by
            #5

            thank you for your reply SergioDanielG,

            but i have display the images in qml gui..how to select from this images

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved