Hello,

In my database I have a table called:

Qt Code:
  1. create table Cursos(
  2. ID_curso int not null auto_increment,
  3. Nome_curso varchar (50),
  4. primary key (ID_curso)
  5. )default charset = utf8;
  6.  
  7. And one table called Cadastrados:
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. create table Cadastrados(
  2. Nome varchar(50),
  3. Matricula varchar(9) unique,
  4. Curso_id int not null,
  5. primary key (Matricula),
  6. foreign key (Curso_id) references Cursos (ID_Curso)
  7. )default charset = utf8;
To copy to clipboard, switch view to plain text mode 

Using QT, I was able to list all Cursos.Nome_curso with comboBox:

Qt Code:
  1. ui->setupUi(this);
  2. model->setQuery("select nome_curso from Cursos");
  3. ui->comboBox->setModel(model);
To copy to clipboard, switch view to plain text mode 

But now I want to select one Nome_Curso of the combobox, and list all the Cadastrados of that respective curso (TableView, maybe?).

But I have no idea where to start. Any help?

Best regards,
DalPai