summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-09-28 20:30:25 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-29 08:54:06 +0200
commite9ccc40c28d11d7d17e6c79a627590f730b7c120 (patch)
tree1d3ddac7217c7d0145e9b6f273d7213b5b60ac23
parent95cebd34ebc5b4d39b11dc91610309a35e488663 (diff)
Get rid of the last traces of QMimeSource
The class has been deprecated since Qt 4.0, but couldn't be removed as QDropEvent inherited from it. Change-Id: I9caa19b30977a319e79255900dee8b2425783f46 Reviewed-on: http://codereview.qt-project.org/5754 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
-rw-r--r--examples/richtext/textedit/textedit.cpp1
-rw-r--r--src/gui/kernel/kernel.pri2
-rw-r--r--src/gui/kernel/qclipboard.cpp97
-rw-r--r--src/gui/kernel/qclipboard.h9
-rw-r--r--src/gui/kernel/qclipboard_p.h131
-rw-r--r--src/gui/kernel/qdnd_p.h2
-rw-r--r--src/gui/kernel/qevent.cpp68
-rw-r--r--src/gui/kernel/qevent.h12
-rw-r--r--src/gui/kernel/qmime.cpp97
-rw-r--r--src/gui/kernel/qmime.h176
-rw-r--r--src/gui/kernel/qplatformclipboard_qpa.cpp1
-rw-r--r--src/gui/text/qtextcontrol.cpp1
-rw-r--r--src/gui/text/qtextcontrol_p.h2
-rw-r--r--src/tools/uic/qclass_lib_map.h4
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp2
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp2
-rw-r--r--src/widgets/itemviews/qabstractitemview_p.h2
-rw-r--r--src/widgets/itemviews/qdirmodel.cpp2
-rw-r--r--src/widgets/widgets/qlineedit_p.h1
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp1
-rw-r--r--src/widgets/widgets/qtextedit.cpp1
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp1
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h2
23 files changed, 13 insertions, 604 deletions
diff --git a/examples/richtext/textedit/textedit.cpp b/examples/richtext/textedit/textedit.cpp
index c8373262c9..e765f58b23 100644
--- a/examples/richtext/textedit/textedit.cpp
+++ b/examples/richtext/textedit/textedit.cpp
@@ -65,6 +65,7 @@
#include <QCloseEvent>
#include <QMessageBox>
#include <QPrintPreviewDialog>
+#include <QMimeData>
#ifdef Q_WS_MAC
const QString rsrcPath = ":/images/mac";
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index 5195b2e3f5..7bdd3079e8 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -18,7 +18,6 @@ HEADERS += \
kernel/qkeysequence.h \
kernel/qkeysequence_p.h \
kernel/qkeymapper_p.h \
- kernel/qmime.h \
kernel/qpalette.h \
kernel/qsessionmanager.h \
kernel/qwindowdefs.h \
@@ -35,7 +34,6 @@ SOURCES += \
kernel/qkeysequence.cpp \
kernel/qkeymapper.cpp \
kernel/qkeymapper_qpa.cpp \
- kernel/qmime.cpp \
kernel/qpalette.cpp \
kernel/qguivariant.cpp \
kernel/qscreen.cpp \
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index ec9ac315f5..970d365af8 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -43,8 +43,8 @@
#ifndef QT_NO_CLIPBOARD
+#include "qmimedata.h"
#include "qpixmap.h"
-#include "qclipboard_p.h"
#include "qvariant.h"
#include "qbuffer.h"
#include "qimage.h"
@@ -137,8 +137,6 @@ QT_BEGIN_NAMESPACE
\sa QApplication
*/
-#ifndef Q_WS_X11
-// for X11 there is a separate implementation of a constructor.
/*!
\internal
@@ -154,13 +152,11 @@ QT_BEGIN_NAMESPACE
*/
QClipboard::QClipboard(QObject *parent)
- : QObject(*new QClipboardPrivate, parent)
+ : QObject(parent)
{
// nothing
}
-#endif
-#ifndef Q_WS_WIN32
/*!
\internal
@@ -172,7 +168,6 @@ QClipboard::QClipboard(QObject *parent)
QClipboard::~QClipboard()
{
}
-#endif
/*!
\fn void QClipboard::changed(QClipboard::Mode mode)
@@ -488,45 +483,6 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode)
\sa QClipboard::Mode, supportsSelection()
*/
-#ifdef QT3_SUPPORT
-/*!
- \fn QMimeSource *QClipboard::data(Mode mode) const
- \compat
-
- Use mimeData() instead.
-*/
-QMimeSource *QClipboard::data(Mode mode) const
-{
- Q_D(const QClipboard);
-
- if (supportsMode(mode) == false)
- return 0;
-
- if (d->compat_data[mode])
- return d->compat_data[mode];
-
- d->wrapper[mode]->data = mimeData(mode);
- return d->wrapper[mode];
-}
-
-
-/*!
- \fn void QClipboard::setData(QMimeSource *src, Mode mode)
- \compat
-
- Use setMimeData() instead.
-*/
-void QClipboard::setData(QMimeSource *source, Mode mode)
-{
- Q_D(QClipboard);
-
- if (supportsMode(mode) == false)
- return;
-
- d->compat_data[mode] = source;
- setMimeData(new QMimeSourceWrapper(d, mode), mode);
-}
-#endif // QT3_SUPPORT
/*!
Returns true if the clipboard supports mouse selection; otherwise
@@ -611,55 +567,6 @@ void QClipboard::emitChanged(Mode mode)
emit changed(mode);
}
-const char* QMimeDataWrapper::format(int n) const
-{
- if (formats.isEmpty()) {
- QStringList fmts = data->formats();
- for (int i = 0; i < fmts.size(); ++i)
- formats.append(fmts.at(i).toLatin1());
- }
- if (n < 0 || n >= formats.size())
- return 0;
- return formats.at(n).data();
-}
-
-QByteArray QMimeDataWrapper::encodedData(const char *format) const
-{
- if (QLatin1String(format) != QLatin1String("application/x-qt-image")){
- return data->data(QLatin1String(format));
- } else{
- QVariant variant = data->imageData();
- QImage img = qvariant_cast<QImage>(variant);
- QByteArray ba;
- QBuffer buffer(&ba);
- buffer.open(QIODevice::WriteOnly);
- img.save(&buffer, "PNG");
- return ba;
- }
-}
-
-QVariant QMimeSourceWrapper::retrieveData(const QString &mimetype, QVariant::Type) const
-{
- return source->encodedData(mimetype.toLatin1());
-}
-
-bool QMimeSourceWrapper::hasFormat(const QString &mimetype) const
-{
- return source->provides(mimetype.toLatin1());
-}
-
-QStringList QMimeSourceWrapper::formats() const
-{
- QStringList fmts;
- int i = 0;
- const char *fmt;
- while ((fmt = source->format(i))) {
- fmts.append(QLatin1String(fmt));
- ++i;
- }
- return fmts;
-}
-
#endif // QT_NO_CLIPBOARD
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qclipboard.h b/src/gui/kernel/qclipboard.h
index fd68a998b0..6902a1362b 100644
--- a/src/gui/kernel/qclipboard.h
+++ b/src/gui/kernel/qclipboard.h
@@ -52,17 +52,13 @@ QT_MODULE(Gui)
#ifndef QT_NO_CLIPBOARD
-class QMimeSource;
class QMimeData;
class QImage;
class QPixmap;
-class QClipboardPrivate;
-
class Q_GUI_EXPORT QClipboard : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(QClipboard)
private:
QClipboard(QObject *parent);
~QClipboard();
@@ -83,10 +79,6 @@ public:
QString text(QString& subtype, Mode mode = Clipboard) const;
void setText(const QString &, Mode mode = Clipboard);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT QMimeSource *data(Mode mode = Clipboard) const;
- QT3_SUPPORT void setData(QMimeSource*, Mode mode = Clipboard);
-#endif
const QMimeData *mimeData(Mode mode = Clipboard ) const;
void setMimeData(QMimeData *data, Mode mode = Clipboard);
@@ -112,7 +104,6 @@ protected:
friend class QGuiApplication;
friend class QBaseApplication;
friend class QDragManager;
- friend class QMimeSource;
friend class QPlatformClipboard;
private:
diff --git a/src/gui/kernel/qclipboard_p.h b/src/gui/kernel/qclipboard_p.h
deleted file mode 100644
index 27fcdea700..0000000000
--- a/src/gui/kernel/qclipboard_p.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QCLIPBOARD_P_H
-#define QCLIPBOARD_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "private/qobject_p.h"
-#include "QtGui/qmime.h"
-#include "QtGui/qclipboard.h"
-
-QT_BEGIN_NAMESPACE
-
-class QClipboardPrivate;
-
-class QMimeDataWrapper : public QMimeSource
-{
-public:
- QMimeDataWrapper() {}
-
- const char* format(int n) const;
- QByteArray encodedData(const char*) const;
-
- mutable QList<QByteArray> formats;
- const QMimeData *data;
-};
-
-class QMimeSourceWrapper : public QMimeData
-{
-public:
- QMimeSourceWrapper(QClipboardPrivate *priv, QClipboard::Mode m);
- ~QMimeSourceWrapper();
-
- bool hasFormat(const QString &mimetype) const;
- QStringList formats() const;
-
-protected:
- QVariant retrieveData(const QString &mimetype, QVariant::Type) const;
-private:
- QClipboardPrivate *d;
- QClipboard::Mode mode;
- QMimeSource *source;
-};
-
-
-class QClipboardPrivate : public QObjectPrivate
-{
-public:
- QClipboardPrivate() : QObjectPrivate() {
- for (int i = 0; i <= QClipboard::LastMode; ++i) {
- compat_data[i] = 0;
- wrapper[i] = new QMimeDataWrapper();
- }
- }
- ~QClipboardPrivate() {
- for (int i = 0; i <= QClipboard::LastMode; ++i) {
- delete wrapper[i];
- delete compat_data[i];
- }
- }
-
- mutable QMimeDataWrapper *wrapper[QClipboard::LastMode + 1];
- mutable QMimeSource *compat_data[QClipboard::LastMode + 1];
-};
-
-inline QMimeSourceWrapper::QMimeSourceWrapper(QClipboardPrivate *priv, QClipboard::Mode m)
- : QMimeData()
-{
- d = priv;
- mode = m;
- source = d->compat_data[mode];
-}
-
-inline QMimeSourceWrapper::~QMimeSourceWrapper()
-{
- if (d->compat_data[mode] == source)
- d->compat_data[mode] = 0;
- delete source;
-}
-
-QT_END_NAMESPACE
-
-#endif // QCLIPBOARD_P_H
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index a94d439811..548e3d2e77 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -55,7 +55,7 @@
#include "QtCore/qobject.h"
#include "QtCore/qmap.h"
-#include "QtGui/qmime.h"
+#include "QtCore/qmimedata.h"
#include "QtGui/qdrag.h"
#include "QtGui/qpixmap.h"
#include "QtGui/qcursor.h"
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index ea19a0548d..bbca4efd0c 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -45,7 +45,7 @@
#include "private/qevent_p.h"
#include "private/qkeysequence_p.h"
#include "qdebug.h"
-#include "qmime.h"
+#include "qmimedata.h"
#include "private/qdnd_p.h"
#include "qevent_p.h"
#include "qmath.h"
@@ -2304,63 +2304,6 @@ QDropEvent::~QDropEvent()
{
}
-/*!
- \compat
- Returns a byte array containing the drag's data, in \a format.
-
- data() normally needs to get the data from the drag source, which
- is potentially very slow, so it's advisable to call this function
- only if you're sure that you will need the data in that
- particular \a format.
-
- The resulting data will have a size of 0 if the format was not
- available.
-
- \sa format() QByteArray::size()
-*/
-
-QByteArray QDropEvent::encodedData(const char *format) const
-{
- return mdata->data(QLatin1String(format));
-}
-
-/*!
- \compat
- Returns a string describing one of the available data types for
- this drag. Common examples are "text/plain" and "image/gif".
- If \a n is less than zero or greater than the number of available
- data types, format() returns 0.
-
- This function is provided mainly for debugging. Most drop targets
- will use provides().
-
- \sa data() provides()
-*/
-
-const char* QDropEvent::format(int n) const
-{
- if (fmts.isEmpty()) {
- QStringList formats = mdata->formats();
- for (int i = 0; i < formats.size(); ++i)
- fmts.append(formats.at(i).toLatin1());
- }
- if (n < 0 || n >= fmts.size())
- return 0;
- return fmts.at(n).constData();
-}
-
-/*!
- \compat
- Returns true if this event provides format \a mimeType; otherwise
- returns false.
-
- \sa data()
-*/
-
-bool QDropEvent::provides(const char *mimeType) const
-{
- return mdata->formats().contains(QLatin1String(mimeType));
-}
/*!
If the source of the drag operation is a widget in this
@@ -2920,15 +2863,6 @@ QShowEvent::~QShowEvent()
}
/*!
- \fn QByteArray QDropEvent::data(const char* f) const
-
- \obsolete
-
- The encoded data is in \a f.
- Use QDropEvent::encodedData().
-*/
-
-/*!
\class QFileOpenEvent
\brief The QFileOpenEvent class provides an event that will be
sent when there is a request to open a file or a URL.
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index faa80d5c7d..7e9ca97051 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -49,7 +49,6 @@
#include <QtCore/qstring.h>
#include <QtGui/qkeysequence.h>
#include <QtCore/qcoreevent.h>
-#include <QtGui/qmime.h>
#include <QtCore/qvariant.h>
#include <QtCore/qmap.h>
#include <QtCore/qvector.h>
@@ -475,9 +474,6 @@ private:
class QMimeData;
class Q_GUI_EXPORT QDropEvent : public QEvent
-// QT3_SUPPORT
- , public QMimeSource
-// END QT3_SUPPORT
{
public:
QDropEvent(const QPoint& pos, Qt::DropActions actions, const QMimeData *data,
@@ -498,13 +494,6 @@ public:
QObject* source() const;
inline const QMimeData *mimeData() const { return mdata; }
-// QT3_SUPPORT
- const char* format(int n = 0) const;
- QByteArray encodedData(const char*) const;
- bool provides(const char*) const;
-// END QT3_SUPPORT
-
-
protected:
friend class QApplication;
QPoint p;
@@ -514,7 +503,6 @@ protected:
Qt::DropAction drop_action;
Qt::DropAction default_action;
const QMimeData *mdata;
- mutable QList<QByteArray> fmts; // only used for QT3_SUPPORT
};
diff --git a/src/gui/kernel/qmime.cpp b/src/gui/kernel/qmime.cpp
deleted file mode 100644
index be0de2bf26..0000000000
--- a/src/gui/kernel/qmime.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qmime.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QMimeSource
- \brief The QMimeSource class is an abstraction of objects that
- provided formatted data of a certain MIME type.
-
- \obsolete
-
- The preferred approach to drag and drop is to use QDrag in
- conjunction with QMimeData. See \l{Drag and Drop} for details.
-
- \sa QMimeData, QDrag
-*/
-
-/*!
- Destroys the MIME source.
-*/
-QMimeSource::~QMimeSource()
-{
-}
-
-/*!
- \fn const char *QMimeSource::format(int i) const
-
- Returns the (\a i - 1)-th supported MIME format, or 0.
-*/
-
-/*!
- \fn QByteArray QMimeSource::encodedData(const char *format) const
-
- Returns the encoded data of this object in the specified MIME
- \a format.
-*/
-
-/*!
- Returns true if the object can provide the data in format \a
- mimeType; otherwise returns false.
-
- If you inherit from QMimeSource, for consistency reasons it is
- better to implement the more abstract canDecode() functions such
- as QTextDrag::canDecode() and QImageDrag::canDecode().
-*/
-bool QMimeSource::provides(const char* mimeType) const
-{
- const char* fmt;
- for (int i=0; (fmt = format(i)); i++) {
- if (!qstricmp(mimeType,fmt))
- return true;
- }
- return false;
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/kernel/qmime.h b/src/gui/kernel/qmime.h
deleted file mode 100644
index af3ec82c09..0000000000
--- a/src/gui/kernel/qmime.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QMIME_H
-#define QMIME_H
-
-#include <QtCore/qmimedata.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Gui)
-
-class Q_GUI_EXPORT QMimeSource
-{
-public:
- virtual ~QMimeSource();
- virtual const char* format(int n = 0) const = 0;
- virtual bool provides(const char*) const;
- virtual QByteArray encodedData(const char*) const = 0;
-};
-
-
-#if defined(Q_WS_WIN)
-
-QT_BEGIN_INCLUDE_NAMESPACE
-typedef struct tagFORMATETC FORMATETC;
-typedef struct tagSTGMEDIUM STGMEDIUM;
-struct IDataObject;
-
-#include <QtCore/qvariant.h>
-QT_END_INCLUDE_NAMESPACE
-
-/*
- Encapsulation of conversion between MIME and Windows CLIPFORMAT.
- Not need on X11, as the underlying protocol uses the MIME standard
- directly.
-*/
-
-class Q_GUI_EXPORT QWindowsMime
-{
-public:
- QWindowsMime();
- virtual ~QWindowsMime();
-
- // for converting from Qt
- virtual bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const = 0;
- virtual bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM * pmedium) const = 0;
- virtual QVector<FORMATETC> formatsForMime(const QString &mimeType, const QMimeData *mimeData) const = 0;
-
- // for converting to Qt
- virtual bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const = 0;
- virtual QVariant convertToMime(const QString &mimeType, IDataObject *pDataObj, QVariant::Type preferredType) const = 0;
- virtual QString mimeForFormat(const FORMATETC &formatetc) const = 0;
-
- static int registerMimeType(const QString &mime);
-
-private:
- friend class QClipboardWatcher;
- friend class QDragManager;
- friend class QDropData;
- friend class QOleDataObject;
-
- static QWindowsMime *converterToMime(const QString &mimeType, IDataObject *pDataObj);
- static QStringList allMimesForFormats(IDataObject *pDataObj);
- static QWindowsMime *converterFromMime(const FORMATETC &formatetc, const QMimeData *mimeData);
- static QVector<FORMATETC> allFormatsForMime(const QMimeData *mimeData);
-};
-
-#endif
-#if defined(Q_WS_MAC)
-
-/*
- Encapsulation of conversion between MIME and Mac flavor.
- Not needed on X11, as the underlying protocol uses the MIME standard
- directly.
-*/
-
-class Q_GUI_EXPORT QMacMime { //Obsolete
- char type;
-public:
- enum QMacMimeType { MIME_DND=0x01, MIME_CLIP=0x02, MIME_QT_CONVERTOR=0x04, MIME_ALL=MIME_DND|MIME_CLIP };
- explicit QMacMime(char) { }
- virtual ~QMacMime() { }
-
- static void initialize() { }
-
- static QList<QMacMime*> all(QMacMimeType) { return QList<QMacMime*>(); }
- static QMacMime *convertor(QMacMimeType, const QString &, int) { return 0; }
- static QString flavorToMime(QMacMimeType, int) { return QString(); }
-
- virtual QString convertorName()=0;
- virtual int countFlavors()=0;
- virtual int flavor(int index)=0;
- virtual bool canConvert(const QString &mime, int flav)=0;
- virtual QString mimeFor(int flav)=0;
- virtual int flavorFor(const QString &mime)=0;
- virtual QVariant convertToMime(const QString &mime, QList<QByteArray> data, int flav)=0;
- virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, int flav)=0;
-};
-
-class Q_GUI_EXPORT QMacPasteboardMime {
- char type;
-public:
- enum QMacPasteboardMimeType { MIME_DND=0x01,
- MIME_CLIP=0x02,
- MIME_QT_CONVERTOR=0x04,
- MIME_QT3_CONVERTOR=0x08,
- MIME_ALL=MIME_DND|MIME_CLIP
- };
- explicit QMacPasteboardMime(char);
- virtual ~QMacPasteboardMime();
-
- static void initialize();
-
- static QList<QMacPasteboardMime*> all(uchar);
- static QMacPasteboardMime *convertor(uchar, const QString &mime, QString flav);
- static QString flavorToMime(uchar, QString flav);
-
- virtual QString convertorName() = 0;
-
- virtual bool canConvert(const QString &mime, QString flav) = 0;
- virtual QString mimeFor(QString flav) = 0;
- virtual QString flavorFor(const QString &mime) = 0;
- virtual QVariant convertToMime(const QString &mime, QList<QByteArray> data, QString flav) = 0;
- virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0;
-};
-
-// ### Qt 5: Add const QStringList& QMacPasteboardMime::supportedFlavours()
-Q_GUI_EXPORT void qRegisterDraggedTypes(const QStringList &types);
-#endif // Q_WS_MAC
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QMIME_H
diff --git a/src/gui/kernel/qplatformclipboard_qpa.cpp b/src/gui/kernel/qplatformclipboard_qpa.cpp
index 66693409d1..c7c779e4eb 100644
--- a/src/gui/kernel/qplatformclipboard_qpa.cpp
+++ b/src/gui/kernel/qplatformclipboard_qpa.cpp
@@ -43,6 +43,7 @@
#ifndef QT_NO_CLIPBOARD
#include <QtGui/private/qguiapplication_p.h>
+#include <QtCore/qmimedata.h>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 17c8d3cb49..34f5271c2d 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -48,7 +48,6 @@
#include <qpainter.h>
#include <qevent.h>
#include <qdebug.h>
-#include <qmime.h>
#include <qdrag.h>
#include <qclipboard.h>
#include <qtimer.h>
diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h
index bb91415fd2..f80c4c81b6 100644
--- a/src/gui/text/qtextcontrol_p.h
+++ b/src/gui/text/qtextcontrol_p.h
@@ -61,6 +61,7 @@
#include <QtGui/qabstracttextdocumentlayout.h>
#include <QtGui/qtextdocumentfragment.h>
#include <QtGui/qclipboard.h>
+#include <QtCore/qmimedata.h>
QT_BEGIN_HEADER
@@ -71,7 +72,6 @@ QT_MODULE(Gui)
class QStyleSheet;
class QTextDocument;
class QTextControlPrivate;
-class QMimeData;
class QAbstractScrollArea;
class QEvent;
class QTimerEvent;
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index 795a8c12cf..6f07ad7d1e 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -810,10 +810,6 @@ QT_CLASS_LIB(QLayoutItem, QtWidgets, qlayoutitem.h)
QT_CLASS_LIB(QSpacerItem, QtWidgets, qlayoutitem.h)
QT_CLASS_LIB(QWidgetItem, QtWidgets, qlayoutitem.h)
QT_CLASS_LIB(QWidgetItemV2, QtWidgets, qlayoutitem.h)
-QT_CLASS_LIB(QMimeSource, QtGui, qmime.h)
-QT_CLASS_LIB(QWindowsMime, QtGui, qmime.h)
-QT_CLASS_LIB(QMacMime, QtGui, qmime.h)
-QT_CLASS_LIB(QMacPasteboardMime, QtGui, qmime.h)
QT_CLASS_LIB(QPalette, QtGui, qpalette.h)
QT_CLASS_LIB(QColorGroup, QtWidgets, qpalette.h)
QT_CLASS_LIB(QPlatformCursorImage, QtGui, qplatformcursor_qpa.h)
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index b26e911899..ce3e54f1f3 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -60,7 +60,7 @@
#include "qstyle.h"
#include "qstyleoption.h"
#include "qvalidator.h"
-#include "qmime.h"
+#include "qmimedata.h"
#include "qspinbox.h"
#include "qdialogbuttonbox.h"
#include "private/qguiplatformplugin_p.h"
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index 10d627c594..82de3f724b 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -42,7 +42,7 @@
#include "qfilesystemmodel_p.h"
#include "qfilesystemmodel.h"
#include <qlocale.h>
-#include <qmime.h>
+#include <qmimedata.h>
#include <qurl.h>
#include <qdebug.h>
#include <qmessagebox.h>
diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h
index cd15694ffe..e1cda31915 100644
--- a/src/widgets/itemviews/qabstractitemview_p.h
+++ b/src/widgets/itemviews/qabstractitemview_p.h
@@ -57,7 +57,7 @@
#include "private/qabstractitemmodel_p.h"
#include "QtWidgets/qapplication.h"
#include "QtGui/qevent.h"
-#include "QtGui/qmime.h"
+#include "QtCore/qmimedata.h"
#include "QtGui/qpainter.h"
#include "QtCore/qpair.h"
#include "QtGui/qregion.h"
diff --git a/src/widgets/itemviews/qdirmodel.cpp b/src/widgets/itemviews/qdirmodel.cpp
index 70958195f7..fd9f0f748a 100644
--- a/src/widgets/itemviews/qdirmodel.cpp
+++ b/src/widgets/itemviews/qdirmodel.cpp
@@ -46,7 +46,7 @@
#include <qfile.h>
#include <qfilesystemmodel.h>
#include <qurl.h>
-#include <qmime.h>
+#include <qmimedata.h>
#include <qpair.h>
#include <qvector.h>
#include <qobject.h>
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index c7d14cbd32..d916ae3185 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -63,6 +63,7 @@
#include "QtCore/qbasictimer.h"
#include "QtWidgets/qcompleter.h"
#include "QtCore/qpointer.h"
+#include "QtCore/qmimedata.h"
#include "QtWidgets/qlineedit.h"
#include "private/qwidgetlinecontrol_p.h"
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 550b2c4784..ec9d251a91 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -46,7 +46,6 @@
#include <qpainter.h>
#include <qevent.h>
#include <qdebug.h>
-#include <qmime.h>
#include <qdrag.h>
#include <qclipboard.h>
#include <qmenu.h>
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 13f03b9908..46a263e0ae 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -48,7 +48,6 @@
#include <qpainter.h>
#include <qevent.h>
#include <qdebug.h>
-#include <qmime.h>
#include <qdrag.h>
#include <qclipboard.h>
#include <qmenu.h>
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 43ebb6b078..e1be88f81b 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -48,7 +48,6 @@
#include <qpainter.h>
#include <qevent.h>
#include <qdebug.h>
-#include <qmime.h>
#include <qdrag.h>
#include <qclipboard.h>
#include <qmenu.h>
diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h
index 67ae0596b3..f1ac09d459 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p.h
@@ -63,6 +63,7 @@
#include <QtGui/qabstracttextdocumentlayout.h>
#include <QtGui/qtextdocumentfragment.h>
#include <QtGui/qclipboard.h>
+#include <QtCore/qmimedata.h>
QT_BEGIN_HEADER
@@ -74,7 +75,6 @@ class QStyleSheet;
class QTextDocument;
class QMenu;
class QWidgetTextControlPrivate;
-class QMimeData;
class QAbstractScrollArea;
class QEvent;
class QTimerEvent;