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 debug into Qt libraries why derived dropMimeData is not being invoked?
Forum Updated to NodeBB v4.3 + New Features

How to debug into Qt libraries why derived dropMimeData is not being invoked?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 418 Views 2 Watching
  • 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 Offline
    J Offline
    JohnGa
    wrote on last edited by
    #1

    Hello,
    To solve a problem I need to have my derived dropMimeData be called by the underlying Qt framework. My situation: I have QTableView that is using a custom model derived from QAbstractTableModel.

    I have set all the necessary properties on the QTableView for drag/drop. When I move a row within the table, I want to invoke the code in my derived dropMimeData.

    After having poured through the various issues on the net, and also trying for hours, I cannot figure out why my derived dropMimeData is not being called when a row is moved within the table. If I could set breakpoints in the QAbstractTableModel methods, this problem would be so easy to solve.

    How can I pull all the Qt classes into the project, in such a way that I can set breakpoints in them?

    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Might be a silly question but did you also setup your views correctly for drag and drop ?
      If so, did you use the override keyword in your subclass ? It will make the compiler scream if you have the signature wrong because you'll be overriding a non-existing method.

      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
      2
      • J Offline
        J Offline
        JohnGa
        wrote on last edited by JohnGa
        #3

        SGaist, a huge thanks for your tip.

        I combed through my code, and through all the samples. Finally found a difference that resolved the issue:

        I was doing:

        qTableView->verticalHeader()->setDragEnabled(true);
        

        After adding the following line, now my derived dropMimeData is getting invoked.

        qTableView->setDragEnabled(true);
        

        Even though this resolves my issue, I still would like to figure out how to attach all the Qt framework source code. Debugging/stepping is a great way to learn frameworks. In the hopes of getting some guidance on how to attach the Qt framework source, I will leave this request open for a little bit. I am searching too. If I find a way, I will definitely post it here.

        aha_1980A 1 Reply Last reply
        1
        • J JohnGa

          SGaist, a huge thanks for your tip.

          I combed through my code, and through all the samples. Finally found a difference that resolved the issue:

          I was doing:

          qTableView->verticalHeader()->setDragEnabled(true);
          

          After adding the following line, now my derived dropMimeData is getting invoked.

          qTableView->setDragEnabled(true);
          

          Even though this resolves my issue, I still would like to figure out how to attach all the Qt framework source code. Debugging/stepping is a great way to learn frameworks. In the hopes of getting some guidance on how to attach the Qt framework source, I will leave this request open for a little bit. I am searching too. If I find a way, I will definitely post it here.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @JohnGa have you installed the Qt sources with MaintenanceTool?

          Qt has to stay free or it will die.

          1 Reply Last reply
          1

          • Login

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