Hello,
As Scope is mentioning you can use the signals connected to different slots.
QDoubleSpinBox::valueChanged(double d);
QLineEdit::textChanged(const QString & text);
Here the tricky part for dynamically update is to have two bool variables, one for NUMBER_1 doublespinbox and the other for NUMBER_3 line edit. So in there respective slots you have to make them true and check for whether the other bool variable is true or not. If other variable is also true then proceed with the calculation and set the value to the Label. Important thing is we have to make both variables to false for next calculation.
//Sample Code looks like.
bool bIsNumber1 = false, bIsNumber3 = false;
//slot connected to DoubleSpinBox signal
void slotDoubleSpinNo1()
{
bIsNumber1 = true;
if(bIsNumber3)
{
//do calculation and set the text to label.
resultLable->setText();
//reset the bool variables
bIsNumber1 = false;
bIsNumber3 = false;
}
}
//Slot connected to LineEdit signal
void slotLineEditNo3()
{
bIsNumber3 = true;
if(bIsNumber1)
{
//do calculation and set the text to label.
resultLable->setText();
//reset the bool variables
bIsNumber1 = false;
bIsNumber3 = false;
}
}
Hope it helps....
Bookmarks