I have build a tool to manage xml tree categories on infinite level but now...
i like insert a function to move up item or swap item ...

My question... exist a similar function from QTreeWidgetItem to make this?
I can access each QTreeWidgetItem by nummer




Qt Code:
  1. void Tree_Category::AppendItemTree()
  2. {
  3. if (Maus_Select_Active) { /* active QTreeWidgetItem */
  4. /*int sotto_totale = Niagara_Actual->childCount();*/
  5. /*niagara->editItem(Niagara_Actual,0);*/
  6. /*qDebug() << "### found 0 " << sotto_totale;*/
  7. bool ok;
  8. QString SetNewName = QInputDialog::getText(this, tr("New Item append here"),tr("Name:"), QLineEdit::Normal,"", &ok);
  9. if (ok && !SetNewName.isEmpty()) {
  10. QTreeWidgetItem *newsub = new QTreeWidgetItem(Niagara_Actual);
  11. watposition++; /* numeration */
  12. QString xput = QString("[%1] %2").arg(QString::number(watposition),SetNewName);
  13. newsub->setText(0,xput);
  14. newsub->setToolTip(0,xput);
  15. PutOptionNow(newsub); /* set various option and put to other class qlist */
  16. }
  17. } else {
  18. QMessageBox::warning( this, tr( "Error" ), tr( "Select on item please!"));
  19. }
  20. }
To copy to clipboard, switch view to plain text mode