salmanmanekia
14th August 2008, 20:54
hi..
this problem is more related to c++ then qt but it also requires previous info about qt so i cannot consult to any pure c++ forums and c++ forum on qtcentre seems to be quite inactive so i thought of banging my question here.. :)
anyways the problem is here..atlast ;)
in the below class scenario i inform the 'superClass' with the value of 'record_click' from 'child1',the superClass then informs 'child2's record_click of this new value...but as you can see that i am using update() function in child2 in which i do record_click-- and i wanted this change to be made to superClass and child1's record_click...i mean that record_click of these two classes should also reduce themself by one
pls see the class 'child1' first ...then the 'super' class
//in superClass
connect(myChild1,SIGNAL(recordClicked(int)),this,S LOT(requestRecord(int)));
void superClass::requestRecord(int rec_clicks)
{
record_clicks = rec_clicks;
//emit requestedRecord(); //this is useless in this case because i wanted to also emit a signal to other widget to listen to
}
void superClass::recognitionAccept() //this method is succesfully called from another class and now i want to pass the recordclick value to the child..
{
..
myChild2->showAcceptedProgress(record_clicks);
..
}
// in my child1 class
..
connect(recordButton,SIGNAL(clicked()),this,SLOT(r eactToRecord()));
..
void child1::reactToRecord()
{
record_clicks++;
disableRecordButton();
emit recordClicked(record_clicks);
}
//in child2 class
void child2::showAcceptedProgress(int rec_clicks)
{
record_clicks = rec_clicks;
..
update();
}
this problem is more related to c++ then qt but it also requires previous info about qt so i cannot consult to any pure c++ forums and c++ forum on qtcentre seems to be quite inactive so i thought of banging my question here.. :)
anyways the problem is here..atlast ;)
in the below class scenario i inform the 'superClass' with the value of 'record_click' from 'child1',the superClass then informs 'child2's record_click of this new value...but as you can see that i am using update() function in child2 in which i do record_click-- and i wanted this change to be made to superClass and child1's record_click...i mean that record_click of these two classes should also reduce themself by one
pls see the class 'child1' first ...then the 'super' class
//in superClass
connect(myChild1,SIGNAL(recordClicked(int)),this,S LOT(requestRecord(int)));
void superClass::requestRecord(int rec_clicks)
{
record_clicks = rec_clicks;
//emit requestedRecord(); //this is useless in this case because i wanted to also emit a signal to other widget to listen to
}
void superClass::recognitionAccept() //this method is succesfully called from another class and now i want to pass the recordclick value to the child..
{
..
myChild2->showAcceptedProgress(record_clicks);
..
}
// in my child1 class
..
connect(recordButton,SIGNAL(clicked()),this,SLOT(r eactToRecord()));
..
void child1::reactToRecord()
{
record_clicks++;
disableRecordButton();
emit recordClicked(record_clicks);
}
//in child2 class
void child2::showAcceptedProgress(int rec_clicks)
{
record_clicks = rec_clicks;
..
update();
}