Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonzqt/dvmimedata.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qstringlist></qstringlist>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// DvMimedata
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DvMimeData::DvMimeData()
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
DvMimeData::~DvMimeData()
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
// cloneData
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
QMimeData *cloneData(const QMimeData *data)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	const DvMimeData *dvData = dynamic_cast<const *="" dvmimedata="">(data);</const>
Toshihiro Shimizu 890ddd
	if (dvData)
Toshihiro Shimizu 890ddd
		return dvData->clone();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QMimeData *newData = new QMimeData();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QStringList list = data->formats();
Toshihiro Shimizu 890ddd
	if (list.isEmpty())
Toshihiro Shimizu 890ddd
		return newData;
Toshihiro Shimizu 890ddd
	QString format = list.first();
Toshihiro Shimizu 890ddd
	if (format.isEmpty())
Toshihiro Shimizu 890ddd
		return newData;
Toshihiro Shimizu 890ddd
	QByteArray byteArray = data->data(format);
Toshihiro Shimizu 890ddd
	if (byteArray.isEmpty())
Toshihiro Shimizu 890ddd
		return newData;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	newData->setData(format, byteArray);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	return newData;
Toshihiro Shimizu 890ddd
}