[Qt-interest] "Unable to save type" when drag in a QTreeWidget
cabieces julien
jcabieces at free.fr
Tue Aug 17 11:22:30 CEST 2010
I forget to implement the mimeData methods, just adding the following lines
solve my problem :
QMimeData* GisBrowser::mimeData( const QList<QTreeWidgetItem *> items )
const
{
return new QMimeData();
}
Thanks
2010/8/17 Andreas Pakulat <apaku at gmx.de>
> On 17.08.10 09:32:41, cabieces julien wrote:
> > Hi,
> >
> > I want to develop drag and drop in a QTreeWidget. So, I implement
> > dragEnterEvent, dragMoveEvent and dropEvent methods. It works fine but
> when
> > I drag, I got this message :
> >
> > QVariant::save: unable to save type 136.
> >
> > Where type 136 belongs to QMetaType::ObjectStar type. It comes from the
> fact
> > that I filled my QTreeWidgetItem data with "QObject*" objects and Qt try
> to
> > serialize it in a DataStream but it doesn't have the appropriates
> operator<<
> > and operator>>.
> >
> > So, I would like to know the good way to implement drag'n drop or maybe
> the
> > way to prevent from this message.
>
> Implementing DnD with Itemviews is described in the Qt documentation:
> http://doc.trolltech.com/latest/model-view-dnd.html
>
> Andreas
>
> --
> You'll be sorry...
> _______________________________________________
> 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/20100817/be9bb6ce/attachment.html
More information about the Qt-interest-old
mailing list