[Qt-interest] Bug in QAbstractItemView drag behaivor?

Alexander G nylocx at gmail.com
Mon Feb 7 09:49:16 CET 2011


Hi,

is there really no one who can reproduce my problem or is my explanation 
unclear somehow?

Alexander

Am 03.02.2011 14:24, schrieb Qt Mailinglists:
> Hi,
>
>
> A few days ago I came across a strange problem with a QListView I use.
>
> If I drag an item which is not visible if the view is scrolled to the
> top there was no QDrag Pixmap displayed. After some debugging I came up
> with this minimal example:
>
> http://pastebin.com/SVY3U7tE
>
> #include<QtCore/QString>
>
> #include<QtGui/QApplication>
> #include<QtGui/QListView>
> #include<QtGui/QStringListModel>
>
> int main(int argc, char *argv[])
> {
> 	QApplication a(argc, argv);
>
> 	QListView dragList;
>
> 	QStringList strings;
> 	for (int i = 1; i<  100; i++)
> 		strings<<  QString("%1. text item").arg(i);
>
> 	QStringListModel *dragModel = new QStringListModel(strings,&dragList);
>
> 	dragList.setDragEnabled(true);
> 	dragList.setDragDropMode(QListView::DragOnly);
> 	dragList.setModel(dragModel);
>
> 	dragList.show();
>
> 	return a.exec();
> }
>
> Can someone confirm that there is a bug if you drag an item which is not
> one of the items which are visible if the view is scrolled to the top.
>
> Sorry for my crappy english, but I hope you where able to understand
> what I tryed to explain.
>
>
> Alexander




More information about the Qt-interest-old mailing list