[Qt-interest] QTableWidget and D&D
Anton Chernov
mechernov at gmail.com
Thu May 26 14:15:50 CEST 2011
4. tableWidget->setSelectionMode(QAbstractItemView<http://doc.qt.nokia.com/latest/qabstractitemview.html>
::NoSelection);
Perhaps you cannot select any item for dragging - try
QAbstractItemView::SingleSelection
2011/5/26 Graham Labdon <Graham.Labdon at avalonsciences.com>
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110526/cf8028b9/attachment.html
More information about the Qt-interest-old
mailing list