我有一个关于QMimeData使用拖放和QClipboard的问题。 场景:
这允许拖放到文件系统和其他应用程序(例如Powerpoint)。 该实现只提供必要的数据(例如,文件系统只需要标题/数据2-5,并拖到例如Powerpoint只需要标题/数据1)。 没有使用中间文件。
MIME数据types(mimeData)的构造按以下方式完成:
void SCImageWidget::createDragAndDropData(QString mimeType) { if(mimeType == "application/x-qt-image" && !mimeData->gotImage) { ... QImage img; this->renderSvgImage(img, ...) mimeData->setImageData(img); mimeData->gotImage = true; ... } else if(mimeType == "FileName" && !mimeData->gotFileName) { QString DDFileName = ... ; mimeData->setData("FileName", DDFileName.toLatin1()); mimeData->gotFileName = true; } else if(mimeType == "FileNameW" && !mimeData->gotFileNameW) { QString DDFileName = ... ; mimeData->setData("FileNameW", QByteArray((const char*) (DDFileName.utf16()), DDFileName.size() * 2)); mimeData->gotFileNameW = true; } else if(mimeType == "FileContents" && !mimeData->gotFileContent) { ... QByteArray data; QBuffer buffer(&data); buffer.open(QIODevice::WriteOnly); this->renderSvgImageToDevice(buffer, ...); buffer.close(); mimeData->setData("FileContents", data); mimeData->gotFileContent = true; ... } else if(mimeType == "FileGroupDescriptorW" && !mimeData->gotFileDesc) { QString DDFileName = ...; FILEGROUPDESCRIPTOR desc; desc.cItems = 1; desc.fgd[0].dwFlags = FD_PROGRESSUI; wcscpy_s(desc.fgd[0].cFileName, DDFileName.toStdWString().c_str()); mimeData->setData("FileGroupDescriptorW", QByteArray((const char*)&desc, sizeof(FILEGROUPDESCRIPTOR))); mimeData->gotFileDesc = true; } return; }
问题:
问题:对于剪贴板和拖放操作,Windows上是否有任何限制(除了剪贴板的典型1/16内存)? 我真的找不到有关这个话题的好消息。 也许任何人都知道Qt中的一些硬编码限制。
系统信息:Dev。 平台:Win 7 64 / 32GB内存,Qt 5.3
SSCCE不是真的可能 – 对不起。