[Qt-interest] QTableWidget and D&D

Graham Labdon Graham.Labdon at avalonsciences.com
Thu May 26 12:02:36 CEST 2011


Hello
I have used Qt Designer to make a dialog containing a QTableWidget.
I have set the following - so that I can drag and drop rows within the table
Qt Code:
Switch view

1.  tableWidget->setAcceptDrops(true);

2.          tableWidget->setDragEnabled(true);

3.          tableWidget->setDefaultDropAction(Qt::MoveAction);

4.          tableWidget->setSelectionMode(QAbstractItemView<http://doc.qt.nokia.com/latest/qabstractitemview.html>::NoSelection);

5.          tableWidget->setSelectionBehavior(QAbstractItemView<http://doc.qt.nokia.com/latest/qabstractitemview.html>::SelectRows);
To copy to clipboard, switch view to plain text mode

However I cannot drag rows within the table

What have I missed

TIA

Graham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110526/23f3d6db/attachment.html 


More information about the Qt-interest-old mailing list