glodata: add global struct data.
This commit is contained in:
@@ -17,12 +17,31 @@ CpTableWidget::~CpTableWidget()
|
||||
|
||||
void CpTableWidget::dropEvent(QDropEvent* event)
|
||||
{
|
||||
if (!event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist")) {
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
QByteArray encoded = event->mimeData()->data("application/x-qabstractitemmodeldatalist");
|
||||
QDataStream stream(&encoded, QIODevice::ReadOnly);
|
||||
|
||||
QList<QTableWidgetItem*> draggedItems;
|
||||
while (!stream.atEnd()) {
|
||||
int row, col;
|
||||
QMap<int, QVariant> roleData;
|
||||
stream >> row >> col >> roleData;
|
||||
if (col != 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CpTableWidget::dragEnterEvent(QDragEnterEvent* event)
|
||||
{
|
||||
|
||||
if (event->mimeData()->hasFormat("application/x-qabstractitemmodeldatalist")) {
|
||||
event->acceptProposedAction();
|
||||
} else {
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user