First of all, I apologize for my English level, long ago I do not practice.

I was trying to do this by my own for a while but I can't. So I need help.
This is the situation:
I have a QPushButton and a QTableWidget. I want that when somebody clicks on the button, a specific cell (the first empty row on the 2 Column position) of the table, set to be editable with some caracteres by default already there ("%" <- exactly).
Now I'm using this SLOT:
Qt Code:
  1. void MainWindow::SLOT_searchNewName(void)
  2. {
  3. this->ClientTable->setFocus();
  4. for (int i = 0; i<TOTAL_FACT; i++)
  5. {
  6. if (!this->ClientTable->item(i,APAGAR) || this->Tabla_Cliente->item(i,APAGAR)->text().isEmpty())
  7. {
  8. // First: delete contents Row of Row who column APAGAR does not exist or is empty
  9. this->ClientTable->removeCellWidget(i,DESC);
  10. for (int b=1; b<6; b++) // Colums
  11. if (this->ClientTable->item(i,b))
  12. delete this->ClientTable->item(i,b);
  13.  
  14. // Second: Prepare the cell:
  15. this->ClientTable->setItem(i,NAME,i_name);
  16. this->ClientTable->setCurrentItem(i_name);
  17. this->ClientTable->setItemSelected(i_name,true);
  18. this->ClientTable->setCurrentCell(i,NAME);
  19.  
  20. break;
  21. }
  22. }
  23. }
To copy to clipboard, switch view to plain text mode 
But this is not exactly what I need. This put the "%" in the correct cell, and make it "Selected", so I can edit it just typing, but, and thats is the important part, by deleting the previos caracter that were there (in this case, the "%", which is crucial, because is a token to search on a DB:
Qt Code:
  1. else if (Column == NAME)
  2. {
  3. this->combo = new QComboBox();
  4. QObject::connect(combo,SIGNAL(activated(int)),this,SLOT(SLOT_backAfterSearch(int)));
  5.  
  6. if (this->ClientTable->item(Row,NAME)->text().startsWith("%")) // <-- That's the token
  7. {
  8. L = this->db.getMedicamentoByName(this->ClientTable->item(Row,NAME)->text());
  9. for (l=L.begin(); l != L.end(); ++l) combo->addItem(l->name+" - "+l->desc);
  10. this->ClientTable->setCellWidget(Row,DESC,combo);
  11. this->combo->setMaxVisibleItems(50);
  12. this->combo->showPopup();
  13.  
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 
).

I want that when the button is clicked, everything works just like now, but when I start typing in the cell given by the button, the words that were there don't be deleted. I believe that have to be something to do that: make that the cell is directly editable with the cursor after the text that is it's there.