[Qt-interest] Drag and Drop Pointers/QModelIndex Within Application
Karol Krizka
kkrizka at gmail.com
Mon May 25 16:32:51 CEST 2009
On Mon, 2009-05-25 at 16:19 +0200, Robert Hairgrove wrote:
> Karol Krizka wrote:
> > On Mon, May 25, 2009 at 1:57 PM, Karol Krizka <kkrizka at gmail.com> wrote:
> >> On Mon, 2009-05-25 at 12:25 +0200, Robert Hairgrove wrote:
>
> [snip]
>
> > I started to implement my own QMimeData class, as suggested at the end
> > of the QMimeData documentation. The documentation also says that I
> > need to reimplement "hasFormat(), formats(), and retrieveData()".
> > While poking around the source code for QMimeData, to see how the
> > function were implemented there, I found out that all data is stored
> > as a QVariant, but all the functions for that are private. I know how
> > to store a pointer to a QObject inside a QVariant... So, my new
> > question is, is there a reason why I cannot directly store my data as
> > a QVariant using the stock QMimeData class? Or even using a custom
> > derivative (which I'm working on) of the QMimeData class?
>
> What does it matter how the data inside of QMimeData is handled when you
> already have a very nice interface for extending it to include your own
> types? Stick to the interface, and you will have fewer problems!
I think I would have fewer problems if I could use the nice QMimeData
interface that is already there, WITHOUT having to extend it. :)
Also, how do you propose that I extend the QMimeData? I was originally
under the impression that you meant to create a new class that inherits
QMimeData (suggested by Qt's documentation too), but some of your
wording makes me doubt that.
--
Cheers,
Karol Krizka
http://www.krizka.net
More information about the Qt-interest-old
mailing list