Qt ─ how to use enum as the QMimeData type/format

Kevin Krammer krammer at kde.org
Mon Feb 3 15:24:08 GMT 2014

Hello Marek,

First of all, you are probably better of reposting this to the developer list:

But since I am replying already :)

On Monday, 2014-02-03, 15:16:49, Marek Kochanowicz wrote:
> Hello,
> I have to admit, that I have some problems understanding the QtMetaTypes
> system. If I clearly misunderstood whole thing, please point this out.
> I need to create QMimeData subclass to store reference to some object. This
> object is of the concrete class, but can be of different semantics,
> depending on the enum member value. Therefore to accept drag I need to set
> the correct format of the QMimeData, depending on the said member enum
> value.

Do we talk about an application internal drag&drop operation here?

In such a case the easiest case might be to store an identifier of some sort 
and let the drop recipient use that to do an look up for the actual object.

In either case this is most likely not related to the Qt meta type system at 


Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde/attachments/20140203/f08a490c/attachment.sig>
-------------- next part --------------
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

More information about the kde mailing list