Hi All
Already i have posted this query in forum ..
My problem is TreeWidget Drag and drop..
I have seen in forum ,some one faced same issue ,what i am facing
How do i write the DropEvent function for accepting drops only TopLevelIems
My code look like
ui->treeWidget->setDragEnabled(true);
ui->treeWidget->setAcceptDrops(true);
ui->treeWidget->setDragEnabled(true);
ui->treeWidget->setAcceptDrops(true);
ui->treeWidget->setDragDropMode(QAbstractItemView ::InternalMove);
To copy to clipboard, switch view to plain text mode
{
qDebug() << "Drag enter event";
eve->accept();
}
{
qDebug() << "Drag move event";
e->accept();
}
{
// QMessageBox::information(0,"",QString("Drop event"));
qDebug() << "Drop function called";
}
void MainWindow::dragEnterEvent(QDragEnterEvent *eve)
{
qDebug() << "Drag enter event";
eve->accept();
}
void MainWindow::dragMoveEvent(QDragMoveEvent *e)
{
qDebug() << "Drag move event";
e->accept();
}
void MainWindow::dropEvent(QDropEvent *event)
{
// QMessageBox::information(0,"",QString("Drop event"));
qDebug() << "Drop function called";
}
To copy to clipboard, switch view to plain text mode
Please help to sort out this problem
Advance thanks for your helping
Thanks
Yuvaraj R
Bookmarks