nina1983
3rd July 2008, 15:33
Dear,
I'm new with Qt, it's one day that I'm trying to solve this problem...
I want to be able to drag and drop elements inside my QTreeWidget but I want that the hierarchy is respected... here an example:
QTreeWidget* tree = new QTreeWidget(QDialog);
tree->setAcceptDrops(true);
tree->setDragEnabled(true);
tree->setDragDropMode(QAbstractItemView::InternalMove);
QTreeWidgetItem* dad = new QTreeWidgetItem(tree,0);
QTreeWidgetItem* child = new QTreeWidgetItem(dad,0);
I want to be able to drag and drop only "dad" elements (with its childs attahced obviously) at the same level as the other "dad" elements...
I hope you can understand my problem... if not please let me know and I'll try to explain it better!
Thank you very much
Lisa
I'm new with Qt, it's one day that I'm trying to solve this problem...
I want to be able to drag and drop elements inside my QTreeWidget but I want that the hierarchy is respected... here an example:
QTreeWidget* tree = new QTreeWidget(QDialog);
tree->setAcceptDrops(true);
tree->setDragEnabled(true);
tree->setDragDropMode(QAbstractItemView::InternalMove);
QTreeWidgetItem* dad = new QTreeWidgetItem(tree,0);
QTreeWidgetItem* child = new QTreeWidgetItem(dad,0);
I want to be able to drag and drop only "dad" elements (with its childs attahced obviously) at the same level as the other "dad" elements...
I hope you can understand my problem... if not please let me know and I'll try to explain it better!
Thank you very much
Lisa