PDA

View Full Version : Problem with Treewidget



addu
30th June 2009, 08:55
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->setDragDropMode(QAbstractItemView ::InternalMove);



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";

}




Please help to sort out this problem


Advance thanks for your helping


Thanks

Yuvaraj R

wysota
30th June 2009, 10:24
Already i have posted this query in forum ..

Why are you opening a new thread about it then? Continue the old one instead.