Results 1 to 2 of 2

Thread: image_deleted

  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 image_deleted

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



    javascript Code:
    1. import QtQuick 2.0
    2. import Qt.labs.folderlistmodel 1.0
    3.  
    4.  
    5. Rectangle {
    6. id:root
    7. width: 360
    8. height: 360
    9.  
    10.  
    11.  
    12. //================ BUTTON : press = remove the selection
    13. Rectangle {
    14. id:button
    15. width: 360
    16. height: 100
    17. color: buttonArea.pressed ? "gray" : "lightgray"
    18. Text {
    19. anchors.centerIn: parent
    20. text:"click to delete selection"
    21. }
    22. MouseArea{
    23. id:buttonArea
    24. anchors.fill: parent
    25. onPressed: root.removeSelection()
    26. }
    27. }
    28.  
    29.  
    30. Rectangle{
    31. width: parent.width-200
    32. height: parent.height/3.6
    33. anchors.bottom: parent.bottom
    34. color: "transparent"
    35. anchors.horizontalCenter: parent.horizontalCenter
    36.  
    37. ListView {
    38. id:list_view_rm
    39. anchors.fill: parent
    40. width: 400; height: 600
    41. clip: true
    42.  
    43.  
    44. orientation: "Horizontal"
    45.  
    46. FolderListModel {
    47. id: folderModel
    48. nameFilters: ["*"]
    49. folder: "image"
    50.  
    51. }
    52.  
    53.  
    54.  
    55. Component {
    56. id: fileDelegate
    57.  
    58. Column {
    59. Rectangle{
    60. id:sss
    61. width: 250; height: 160
    62. border.color: "white"
    63. border.width: 2
    64. color:"transparent"
    65.  
    66.  
    67. Image {
    68. id:image_click
    69. anchors.fill: parent
    70. //anchors.centerIn: parent
    71. anchors.horizontalCenter: parent.horizontalCenter
    72. width: parent.width; height: parent.height
    73. fillMode:Image.PreserveAspectFit
    74. smooth: true
    75. source:folderModel.folder + "/" + fileName
    76.  
    77. }
    78. Text { text: fileName
    79. anchors.bottom: parent.bottom
    80. // anchors.leftMargin: 20
    81. anchors.horizontalCenter: parent.horizontalCenter
    82. color: "white"
    83. font.bold: true
    84. }
    85. }
    86. }
    87.  
    88. }
    89. highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
    90.  
    91. model: folderModel
    92. delegate: fileDelegate
    93. }
    94.  
    95.  
    96. }
    97.  
    98.  
    99. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 4th July 2013 at 01:19.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: image_deleted

    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/5513...ete-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 [code][/code]
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  3. The following user says thank you to ChrisW67 for this useful post:

    anda_skoa (4th July 2013)

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.