hi, i have a problem that i can't solve for the moment.
I have a list where i load a list of messages, each message is displayed in a widget panel.

i'm trying to perform go up & down actions with a up & down buttons and i don´t know how to remove a widget and insert it again one position before.

could anyone help me??

here there are some code:

Qt Code:
  1. QWidget *scrollWidget = ui.scrollTx;
  2. QLayout *layout = scrollWidget->layout ();
  3.  
  4. //this code is to remove panels that they already are in the list
  5. QLayoutItem *child = 0;
  6. while ((child = layout->takeAt(0)) != 0)
  7. {
  8. QWidget *widget = child->widget();
  9. if (widget) widget->deleteLater();
  10. delete child;
  11. }
  12.  
  13. // with this code i create the panels
  14. for (it = m_cListaTx.begin (); it != m_cListaTx.end ();)
  15. {
  16. CArincMsgData *msg = *it;
  17. if (msg)
  18. {
  19. PanelTx *panel = new PanelTx (msg, *this, layout->widget());
  20. layout->addWidget (panel);
  21.  
  22. }
  23. it++;
  24. }
  25.  
  26. ((QVBoxLayout *)layout)->addStretch ();
To copy to clipboard, switch view to plain text mode 

but afterthat in other function i need to insert panels between some of them,
and i just have found this method to insert widgets: layout->addWidget (panel);

can i perform what i want?

thanks anyway