Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Avoid QTreeWidgetItem to have children

    General and Desktop
    1
    1
    776
    Loading More Posts
    • 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.
    • E
      excalibur1491 last edited by

      Hi,

      I have been working with QTreeWidget and QTreeWidgetItem and I have had some problems to be able to drag&drop QTreeWidgetITems form a QTreeWidget to another. Anyway I found a way to do it by reimplementing the dropEvent.

      Now, I still have a problem... This is my current situation:
      I have a class Item which inherits form QTreeWidgetItem and a class TWidget wich inherits from QTreeWidget (with its dropEvent method reimplemented, as I said above).
      What I want is to be able to drag&drop items into other items (to create "groups"), but not for all the items. I have a boolean property in my Item class that says "if true, I can be a group, if false, I can't". So I want to be able to drag and drop Items into other Items only if this boolean is set to true for the target.

      The best information I have found yet is this: http://www.qtcentre.org/threads/5910-QTreeWidget-Drag-and-drop , but does not help me much because I don't have any idea how to reimplement dropMimeData.. I don't even understand wha this method does from reading the documentation.

      Any suggestion?
      Thank you!

      1 Reply Last reply Reply Quote 0
      • First post
        Last post