8#include <QtCore/private/qcore_unix_p.h>
9#include <QtGui/private/qguiapplication_p.h>
10#include <qpa/qplatformclipboard.h>
12#include <QtCore/QDebug>
14using namespace std::chrono;
42 if (originalMime == newMime)
49 if (
data.size() > 1) {
53 if ((byte0 == 0xff && byte1 == 0xfe) || (byte0 == 0xfe && byte1 == 0xff)
54 || (byte0 != 0 && byte1 == 0) || (byte0 == 0 && byte1 != 0)) {
57 reinterpret_cast<const char16_t *
>(
data.constData()),
data.size() / 2);
61 for (
int i = 0;
i < urls.size();
i += 2) {
62 const QUrl url(urls.at(
i).trimmed().toString());
99 if (m_mimeData->formats().isEmpty())
102 return m_mimeData->formats().first();
107 return m_mimeData.data();
116 return m_supportedActions;
127 m_mimeData->appendFormat(mime_type);
139 m_supportedActions = Qt::DropActions();
140 if (source_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE)
142 if (source_actions & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY)
147 : m_dataOffer(dataOffer)
204 qWarning(
"QWaylandMimeData: pipe2() failed");
213 if (
readData(pipefd[0], content) != 0) {
230 struct pollfd readset;
232 readset.events = POLLIN;
237 qWarning() <<
"QWaylandDataOffer: qt_safe_poll() failed";
239 }
else if (ready == 0) {
240 qWarning(
"QWaylandDataOffer: timeout reading from pipe");
247 qWarning(
"QWaylandDataOffer: read() failed");
bool endsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void chop(qsizetype n)
Removes n bytes from the end of the byte array.
bool remove(const Key &key)
Removes the item that has the key from the hash.
const_iterator constFind(const Key &key) const noexcept
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
static QString fromUtf16(const char16_t *, qsizetype size=-1)
bool isNull() const
Returns true if this string is null; otherwise returns false.
bool isValid() const
Returns true if the URL is non-empty and valid; otherwise returns false.
QByteArray toEncoded(FormattingOptions options=FullyEncoded) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
virtual void startReceiving(const QString &mimeType, int fd)=0
QWaylandDataOffer(QWaylandDisplay *display, struct ::wl_data_offer *offer)
Qt::DropActions supportedActions() const
QMimeData * mimeData() override
void data_offer_action(uint32_t dnd_action) override
void data_offer_offer(const QString &mime_type) override
void data_offer_source_actions(uint32_t source_actions) override
QString firstFormat() const
void startReceiving(const QString &mimeType, int fd) override
~QWaylandDataOffer() override
struct wl_display * wl_display() const
~QWaylandMimeData() override
QVariant retrieveData_sys(const QString &mimeType, QMetaType type) const override
void appendFormat(const QString &mimeType)
QStringList formats_sys() const override
QWaylandMimeData(QWaylandAbstractDataOffer *dataOffer)
bool hasFormat_sys(const QString &mimeType) const override
QSet< QString >::iterator it
struct wl_display * display
Combined button and popup list for selecting options.
static QString portalFileTransfer()
static QByteArray convertData(const QString &originalMime, const QString &newMime, const QByteArray &data)
static QString utf8Text()
int qt_safe_poll(struct pollfd *fds, nfds_t nfds, QDeadlineTimer deadline)
static int qt_safe_pipe(int pipefd[2], int flags=0)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
QUrl url("example.com")
[constructor-url-reference]
application x qt windows mime
[2]