Ignore:
Timestamp:
Jan 23, 2010, 3:44:11 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: DnD: Added support for dragging empty QMimeData with no formats (used in particular by QDesigner for in-process drag and drop).

File:
1 edited

Legend:

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

    r469 r470  
    913913    }
    914914
     915    if (!mimeData->formats().count()) {
     916        // The drag source doesn't provide any format, so we've got no workers.
     917        // Although it may look strange, but it is a supported case: for
     918        // example, designer uses it a lot for in-process DnD. Instead of MIME
     919        // data, it works directly with the QMimeData object from the drag
     920        // source. We will go through the converters passing a special value of
     921        // QString::null as MIME type -- one of them (e.g. QPMAnyMime) should
     922        // take it over and return itself.
     923        Q_ASSERT(!workers.count());
     924        DEBUG(() << "QPMCoopDragWorker: Source provides NO data, looking for a "
     925                    "converter that can handle this");
     926        foreach (QPMMime *mime, QPMMime::all()) {
     927            DragWorker *wrk = mime->dragWorkerFor(QString::null, mimeData);
     928            if (wrk) {
     929                workers.append(wrk);
     930                break;
     931            }
     932        }
     933    }
     934
    915935#if defined(QDND_DEBUG)
    916936    foreach (DragWorker *wrk, workers) {
Note: See TracChangeset for help on using the changeset viewer.