Qt Forum

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

    Call for Presentations - Qt World Summit

    Unsolved Drag and Drop to a QTreeWidget subclass

    General and Desktop
    drag and drop qtreewidget
    2
    2
    611
    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.
    • J
      jcga last edited by

      Hi,

      I have an application with a QMainWindow that has a subclass of QTreeWidget, say MyTreeWidget, as central widget. I can drag and drop normaly to the MainWindow widget, but not to MyTreeWidget. In fact the override MyTreeWidget::dragEnterEvent() is called, but MyTreeWidget::dropEvent() never is. I verifyed that setAcceptDrops(true) is called in the constructor of MyTreeWidget(), and I verified that inside MyTreeWidget::dragEnterEvent(), acceptDrops() returns 'true'.

      Any suggestion is appreciated.

      JClaude

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        You should share the code of your MyWidgetTree class. That way it will make things easier to analyse.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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