简体   繁体   English

Qt,C ++:QListWidget内部拖放 - 如何连接信号?

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

I write in C++ using Qt, and I have a list widget. 我使用Qt用C ++编写,并且有一个列表小部件。

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 myList->model()->rowsMoved()myList->model()->layoutChanged

Links to docs: 指向文档的链接:

QAbstractItemModel::rowsMoved

QAbstractItemModel::layoutChanged

Example: 例:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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