[Qt-interest] Fwd: mime data

ami guru dosto.walla at gmail.com
Tue Dec 30 19:42:10 CET 2008


Hello forum,

I have some data types not defined in the QMimeData and the drag  & drop
operation occurs within a single application.

So i have decided to subclass QMimeData() and reimplement
hasFormat<qmimedata.html#hasFormat>(),
formats <qmimedata.html#formats>(), and
retrieveData<qmimedata.html#retrieveData>().



Cant fugure out the dfinitions inside the functions.

Lets start with formats()


QStringList H3DNodeData::formats() const
{
  return myFormat;
}


myFormat is a private variable that has been set as myFormat << "text/plain"
<< "icon";


need some hint about the rest of the functions.


Thanks
Sajjad

---------- Forwarded message ----------
From: ami guru <dosto.walla at gmail.com>
Date: Tue, Dec 30, 2008 at 5:30 PM
Subject: Fwd: [Qt-interest] mime data
To: qt-interest at trolltech.com


Thanks Bob,

I thought about that as well.

Then i pondered a bit ; Are QIcon and QImage  the same ?

I am dealing with QIcon that is not defined in the QMimeData

Regards
Sajjad


---------- Forwarded message ----------
From: Robert Hairgrove <evorgriahr at hispeed.ch>
Date: Tue, Dec 30, 2008 at 5:06 PM
Subject: Re: [Qt-interest] mime data
To: qt-interest at trolltech.com


ami guru wrote:
> When implementing drag and drop support in a custom model, it is
> possible to export items of data in specialized formats by
> reimplementing the following function - as specified in the manual:
>
> QMimeData mimeData(const QModelIndexList&) const
>
> I have string and icon that need to be set. Icon type is not defined in
> the QMimeData .
>
> Should i subclass QMimeData or use the QMimeData::setData() .

You probably want to use this function:

void QMimeData::setImageData ( const QVariant & image );

Bob
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081230/b7debf1a/attachment.html 


More information about the Qt-interest-old mailing list