HI,
I wanted to drag & drop custom mime data between two windows (basically 2 QTreeview's in the same application), But when I use this custom mimedata I am not able to drop any data (I could see + sign while dragging in 1st window & the moment I leave the 1st winnow the + sign is changing to ForbiddenCursor & I am not able to drop data in 2nd window)
My classs:
{
Q_OBJECT
public:
bool hasFormat
(const QString &mimetype
) const { return QMimeData::hasFormat(mimetype
);
} };
class MyMimedata : public QMimeData
{
Q_OBJECT
public:
MyMimedata () : QMimeData() { }
bool hasFormat(const QString &mimetype) const { return QMimeData::hasFormat(mimetype); }
QStringList formats() const{ return QMimeData::formats(); }
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const { QMimeData::retrieveData(mimetype, preferredType); }
};
To copy to clipboard, switch view to plain text mode
I am not able to drag & drop above custome data type.
When I use
Q_DECLARE_METATYPE(MyMimedata );
Q_DECLARE_METATYPE(MyMimedata );
To copy to clipboard, switch view to plain text mode
I am getting compile time error: 'QMimeData::QMimeData(const QMimeData&)' is private
What am I doing wrong here.... any hint ??
Bookmarks