Hello,
I have some problems with drag and drop between differents QTableWigdet.
Table A is source information, where I selected and drag the entire row but the last cell.
snapshot1.jpg
Now, I would like to drop this information in Table B. (botton QTableWidget).
I have implemented dragEnterEvent, dragMoveEvent, dropEvent and dragLeaveEvent and it works fine.
but now I have some problems:Qt Code:
#include <QtGui> #include <QDebug> #include "LeiTableWidget.h" { setAcceptDrops(true); setAutoFillBackground(true); clear(); } { // qDebug() << "dragEnterEvent"; event->acceptProposedAction(); } { // qDebug() << "dragMoveEvent"; event->acceptProposedAction(); } { qDebug() << "dropEvent"; if(table->currentItem() != NULL) { // Tengo las coordenadas del elemento que se ha arrastrado desde su origen //************************************************************************** } qDebug() << table->currentItem()->row() << "-" << table->currentItem()->column() ; qDebug() << "mine data " << event->mimeData()->text(); event->acceptProposedAction(); } { // qDebug() << "dragLeaveEvent"; event->accept(); } void LeiTableWidget::clear() { }To copy to clipboard, switch view to plain text mode
1.- If a drop in a cell different than column 0, write incorrect data in table.
snapshot2.jpg
2.- How can I detect what information or items has drop action?
3.- How can I detect what row is select to drop?
Best regards.
Bookmarks