简体   繁体   中英

Qt, C++: QListWidget internal drag&drop - how to connect to signal?

I write in C++ using Qt, and I have a list widget.

I enabled internal drag & drop, using:

list->setDragDropMode(QAbstractItemView::InternalMove);

What should I do for catching the signal that says that such a drag & drop action was done?

Thanks!

Just assuming this is the sort of signals your looking for...

myList->model()->rowsMoved() or myList->model()->layoutChanged

Links to docs:

QAbstractItemModel::rowsMoved

QAbstractItemModel::layoutChanged

Example:

connect(list->model(), SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), this, SLOT(myFunction()));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM