Sorry
, I hope your not sick of me anda_skoa, I try looking on the docs and over the internet for solutions and I post whenever I can't find a solution.
Here is the connect statement:
connect(table,SIGNAL(doubleClicked(QModelIndex)),this,SLOT(rSelect(QModelIndex)));
To copy to clipboard, switch view to plain text mode
Here is the slot which in turns emits another signal so the QDialog know what data to extract:
int rand=index.row();
QString id
=index.
sibling(rand,
0).
data().
toString();
emit semnalAngSel(id);
}
void ListaAng::rSelect(QModelIndex index){
int rand=index.row();
QString id=index.sibling(rand,0).data().toString();
emit semnalAngSel(id);
}
To copy to clipboard, switch view to plain text mode
Here I create the table and connect the semnalAngSel(QString) signal:
void widget
::tabelSql(QString tab
){ curatare(); //this is a function which cleans the layout
if(tab=="lAng"){
ListaAng *lAng=new ListaAng();
connect(lAng,
SIGNAL(semnalAngSel
(QString)),
this,
SLOT(ferVizAng
(QString)));
layoutCentral->addWidget(lAng);
lAng->selectPrimR();
}
}
void widget::tabelSql(QString tab){
curatare(); //this is a function which cleans the layout
if(tab=="lAng"){
ListaAng *lAng=new ListaAng();
connect(lAng,SIGNAL(semnalAngSel(QString)),this,SLOT(ferVizAng(QString)));
layoutCentral->addWidget(lAng);
lAng->selectPrimR();
}
}
To copy to clipboard, switch view to plain text mode
And here is where I call my Dialog:
void widget
::ferVizAng(QString id
){ FerDialAng *fda=new FerDialAng(this,id);
connect(fda,
SIGNAL(semnalAct
(QString)),
this,
SLOT(tabelSql
(QString)));
//here I call the table to "refresh" fda->exec();
}
void widget::ferVizAng(QString id){
FerDialAng *fda=new FerDialAng(this,id);
connect(fda,SIGNAL(semnalAct(QString)),this,SLOT(tabelSql(QString))); //here I call the table to "refresh"
fda->exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks