Advertisement
Guest User

Untitled

a guest
Feb 27th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. char znak[3]={'+', '-', '*'};
  2.  
  3. connect(ui.sumButton, SIGNAL(clicked()), this, SLOT(getAndshowResult(znak[0])));
  4. connect(ui.subButton, SIGNAL(clicked()), this, SLOT(getAndshowResult(znak[1])));
  5.  
  6. void GUI::getAndshowResult(char &f) {
  7.     if (!getValues())
  8.     {
  9.         clearAllTextFields();
  10.     }
  11.     else {
  12.         Kalkulator nowy(a, b);
  13.         ui.wyswietlEdit->setText(QString::number(nowy.doCalc(f)));
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement