Hello ,

In code I am trying to implement, that on every button click my data should be reduce.
Qt Code:
  1. constructor()
  2. {
  3. connect(ui->pb_uss2ecu_readleft,SIGNAL(clicked()),this,SLOT(Read_File_uss2ecuLeft()));
  4. }
  5. somefunction()
  6. {
  7. uss2ecu_count = 144;
  8. }
  9. Read_File_uss2ecuLeft()
  10. { qDebug()<<"uss2ecu_count_first"<<uss2ecu_count;
  11. uss2ecu_count--;
  12. qDebug()<<"uss2ecu_count_last"<<uss2ecu_count;
  13. }
To copy to clipboard, switch view to plain text mode 

My output is
First Click
uss2ecu_count_first 144
uss2ecu_count_last 143
second Click
uss2ecu_count_first 189
uss2ecu_count_last 188

That is on every time click it is increasing the data rather than taking old data
My Output should be
First Click
uss2ecu_count_first 144
uss2ecu_count_last 143
second Click
uss2ecu_count_first 143
uss2ecu_count_last 142