Hi,

I have a QTableWidget with QTextBrowser inherit Widgets on its cells. But when I want to delete a Item I can't reconnect the rest of items.

The code of remove function is the next:
Qt Code:
  1. void Itinerario::on_eliminarToolButton_clicked(){
  2. desconectarWaypoints();
  3.  
  4. for(int i=0;i<waypoints->rowCount();i++){
  5. WaypointItem *item=static_cast<WaypointItem*>(waypoints->cellWidget(i, TEXTBROWSER_CELLITEM));
  6. if(item->selected()){
  7. if(QMessageBox::question(this, "", "Esta seguro de que desea eliminar el Waypoint?",
  8. QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes){
  9. item->disconnect();
  10. waypoints->removeRow(i);
  11.  
  12. setWindowModified(true);
  13. }
  14.  
  15. return;
  16. }
  17. }
  18. reconectarWaypoints();
  19. }
To copy to clipboard, switch view to plain text mode 

The code of remove connections is:
Qt Code:
  1. void Itinerario::desconectarWaypoints(){
  2. for(int i=0;i<waypoints->rowCount();i++){
  3. WaypointItem *item=static_cast<WaypointItem*>(waypoints->cellWidget(i, TEXTBROWSER_CELLITEM));
  4.  
  5. item->disconnect();
  6. }
  7. }
To copy to clipboard, switch view to plain text mode 

And the code of reconnect connections finally is:
Qt Code:
  1. void Itinerario::reconectarWaypoints(){
  2. for(int i=0;i<waypoints->rowCount();i++){
  3. WaypointItem *item=static_cast<WaypointItem*>(waypoints->cellWidget(i, TEXTBROWSER_CELLITEM));
  4.  
  5. connect(item, SIGNAL(clicked(WaypointItem*, int)), SLOT(waypointClicked(WaypointItem*, int)));
  6. connect(item, SIGNAL(doubleClick(WaypointItem*, int)), SLOT(waypointDoubleClicked(WaypointItem*, int)));
  7. connect(item, SIGNAL(modifiedChange(bool)), parent(), SLOT(setWindowModified(bool)));
  8. }
  9. }
To copy to clipboard, switch view to plain text mode 

I want to reconnect because if I dont do remove-reconnect the connection of removed item appears to be here.

Thanks