[SOLVED] QListWidget InternalMove adds children
I experienced a strange behavior of my QListWidget. Therefore I prepared this example.
class ListWidget : public QListWidget
ListWidget(QWidget *parent = 0);
#endif // LISTWIDGET_H
this->setDragDropMode( QAbstractItemView::InternalMove ); connect( this->model(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(rowsMoved(QModelIndex,int,int,QModelIndex,int)));
qDebug() << this->children().count();
If I start this and move the two items around, every time the children count raises by one. Is this expected behaviour? If yes, could someone explain me why?
It doesn't look like an expected behavior. What version of Qt are you using ?
Hey, I'm using Qt 5.2.1.
Sorry for the late reply
Can you try again with 5.3 ?
If this still happens, then have a look at the "bug report system":http://bureports.qt-project.org to see if it's something known. If not please open a new report providing a minimal compilable example that shows the behavior
Tried it with 5.3, still the same. Search for a while at the "bug report system":bugreports.qt-project.org but didn't find anything related to this. Therefore I openend a new "report":https://bugreports.qt-project.org/browse/QTBUG-39651.
I hope I did this the right way, as it is the first time I reported something.
It's missing the pro file and it'll be nicer in a compressed archive (e.g. zip), otherwise, looks good :)