I know this is a typical error message, but I cannot find a solution in the other post I found on it.
I have the following code:

Qt Code:
  1. void Ligas::SetId(const QString s,QSqlDatabase *datos)
  2. {
  3. if(datos == NULL){
  4. qDebug() << "NULL database";
  5. return;
  6. }
  7. if(!datos->isOpen()){
  8. qDebug() << "Failed to open the database";
  9. return;
  10. }
  11. qDebug() << "step 1: " << s;
  12. setWindowTitle(s);
  13. qDebug() << "step 2";
  14. ui->listWidget_estad->clear();
  15. qDebug() << "step 3";
  16. ui->listWidget_nombres->clear();
  17. qDebug() << "step 4";
  18. ...
  19. }
To copy to clipboard, switch view to plain text mode 

I get to "Step 1" before the message error:

The inferior stopped because it received a signal from the Operating System.

Signal name : SIGSEGV
Signal meaning : Segmentation fault
If I delete setWindowTitle(s); I get the very same error after Step 2. So I am really confused. Can anybody help me?

The program used to work fine before adding new rows into the database.