Originally Posted by
para
I am having the same problem, trying to drag&drop from one table to another.
Does this work for you?
#include <QtGui>
{
tableWidget->setDragEnabled(true);
tableWidget->setAcceptDrops(true);
tableWidget->setDropIndicatorShown(true);
return tableWidget;
}
int main(int argc, char* argv[])
{
splitter.addWidget(createTableWidget(&splitter));
splitter.addWidget(createTableWidget(&splitter));
splitter.show();
return a.exec();
}
#include <QtGui>
QTableWidget* createTableWidget(QWidget* parent)
{
QTableWidget* tableWidget = new QTableWidget(4, 4, parent);
tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
tableWidget->setDragEnabled(true);
tableWidget->setAcceptDrops(true);
tableWidget->setDropIndicatorShown(true);
return tableWidget;
}
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
QSplitter splitter;
splitter.addWidget(createTableWidget(&splitter));
splitter.addWidget(createTableWidget(&splitter));
splitter.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks