thanks for the reply..your solution seems to be good but my problem seems to be different....
hmm..i will put some more code to define the problem..
basically in my superClass i am using a connect statetmemt to see if the rec_button value has increased in myChild1 and it emits the change to myChild2 ..static doesnt seem to work ,it doesnt allows to change..
pls see the class 'child1' first ...then the 'super' class
//in superClass
connect(myChild1,SIGNAL(recordClicked(int)),this,SLOT(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 superClass
connect(myChild1,SIGNAL(recordClicked(int)),this,SLOT(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);
..
}
To copy to clipboard, switch view to plain text mode
// in my child1 class
..
connect(recordButton,SIGNAL(clicked()),this,SLOT(reactToRecord()));
..
void child1::reactToRecord()
{
record_clicks++;
disableRecordButton();
emit recordClicked(record_clicks);
}
// in my child1 class
..
connect(recordButton,SIGNAL(clicked()),this,SLOT(reactToRecord()));
..
void child1::reactToRecord()
{
record_clicks++;
disableRecordButton();
emit recordClicked(record_clicks);
}
To copy to clipboard, switch view to plain text mode
//in child2 class
void child2::showAcceptedProgress(int rec_clicks)
{
record_clicks = rec_clicks;
..
update();
}
//in child2 class
void child2::showAcceptedProgress(int rec_clicks)
{
record_clicks = rec_clicks;
..
update();
}
To copy to clipboard, switch view to plain text mode
Bookmarks