title: Qt Drag and Drop - Change image display while dragging
body: <p>I started a drag with image.</p>
  
  <pre><code>QDrag* drag = new(QDrag)(this);
  drag-&gt;setPixmap(*pixmap);
  drag-&gt;exec(Qt::CopyAction | Qt::MoveAction);
  </code></pre>
  
  <p>I want to change the image display when my drag reach certain point in the widget.</p>
  
  <p>Currently I have an idea. After I start the first drag, when my drag reaches a certain point, I cancel the first drag then I restart a new drag with a new image.</p>
  
  <p>I do this in <code>dragMoveEvent</code>. I'm able to start a new drag with a new image. But I seem to be unable to cancel the first drag. I find that the the previous drag/drop action is still being performed.</p>
  
  <p>Anyone could suggest:</p>
  
  <pre><code>if (event-&gt;mimeData()-&gt;hasText())
  {
    if (need_to_change_pixmap())
    {
      event-&gt;setDropAction(Qt::IgnoreAction);
      change_pixmap_restart_drag();
    }
    else
    {
      event-&gt;setDropAction(Qt::MoveAction);
      event-&gt;accept();
    }
  }
  else
  {
    event-&gt;ignore();
  }
  </code></pre>
  
  <p>The <strong><code>change_pixmap_restart_drag</code></strong> function just do start drag.</p>