6#include <QtCore/qurl.h>
7#include <QtCore/qmimedata.h>
33 if (shouldIgnore(pformatetc))
34 return ResultFromScode(DATA_E_FORMATETC);
42 if (shouldIgnore(pformatetc))
43 return ResultFromScode(DATA_E_FORMATETC);
51bool QWindowsDropDataObject::shouldIgnore(LPFORMATETC pformatetc)
const
55 if (dropData && dropData->
formats().size() == 1 && dropData->
hasUrls()) {
57 if (pformatetc->cfFormat == CF_UNICODETEXT
58 || pformatetc->cfFormat == CF_TEXT
61 const auto urls = dropData->
urls();
62 return std::all_of(urls.cbegin(), urls.cend(), [] (
const QUrl &u) { return u.isLocalFile(); });
bool hasUrls() const
Returns true if the object can return a list of urls; otherwise returns false.
QList< QUrl > urls() const
Returns a list of URLs contained within the MIME data object.
virtual QStringList formats() const
Returns a list of formats supported by the object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
STDMETHOD() QueryGetData(LPFORMATETC pformatetc) override
STDMETHOD() GetData(LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium) override
QWindowsDropDataObject(QMimeData *mimeData)
~QWindowsDropDataObject() override
static QString clipboardFormatName(int cf)
QMimeData * mimeData() const
STDMETHOD() QueryGetData(LPFORMATETC pformatetc) override
STDMETHOD() GetData(LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium) override
Combined button and popup list for selecting options.
static QByteArray formatName(int format)
#define QStringLiteral(str)