Changeset 463 for trunk/src


Ignore:
Timestamp:
Jan 21, 2010, 9:52:06 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: DnD: Respect the change to the drop action applications may make in the QDropEvent handlers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qdnd_pm.cpp

    r462 r463  
    697697            QMimeData *data = manager->source() ? manager->dragPrivate()->data : manager->dropData;
    698698
    699             QDropEvent de(pnt, dragData->lastAction, data, mouseButtons(),
    700                           keyboardModifiers());
     699            QDropEvent de(pnt, toQDragDropActions(dragData->supportedOps),
     700                          data, mouseButtons(), keyboardModifiers());
    701701            if (dragData->lastDropReply == DOR_DROP)
    702702                de.setDropAction(dragData->lastAction);
    703 
    704703            sendDropEvent(dragData->lastDragOverWidget, &de);
    705704
    706705            if (dragData->lastDropReply == DOR_DROP)
    707706                de.accept();
     707
     708            if (de.isAccepted()) {
     709                // We must update usOperation so that if the application changes
     710                // the drop action during processing of the QDropEvent this
     711                // change will be visible at the DrgDrag() end. This is odd (since
     712                // it may be easily made out of sync with the visual indication)
     713                // but needed for compatibility with other platforms.
     714                info->usOperation = toPmDragDropOp(de.dropAction());
     715            }
    708716
    709717            dragData->lastDragOverWidget = 0;
Note: See TracChangeset for help on using the changeset viewer.