I found something interesting, I hope someone can explain me what am I doing wrong.
Now, in a table I've a slot connected to currentRowChanged signal, so that when a row on the master table is selected, the slave table is updated (i.e., filtered). The slot attached to the signal is like the following:
@if( modelIndex.isValid() ){
// filter
}
}
else{
doSlaveClean();
}
@
and the doSlaveClean method removes the model from the view and calls clear:
@void BasePerspective::doSlaveClean()
{
tableView->setModel( NULL );
tableModel->tableName();
}@
Now, this works fine if the doSlaveClean is called only once per slot execution. I mean, when a row is de-selected in the master table, the signal is emitted, the slot calls doSlaveClean and the table is cleaned without loosing the table name. If, within the same slot, I call another time doSlaveClean, the table model appears not to be bound to a table. Is this a kind of concurrency problem of the signal/slot mechanism? Now, why should I call twice the doSlaveClean? Because I forget that de-selecting a row emits currentRowChanged ...
Anyone can give me an hint about this?