Buttons do not calculate. Buttons can send a signal that they have been clicked. The signal can be connected to a "slot" function, which will be executed whenever the signal is emitted.
Ok, we see a function that does calculate something. However, we cannot possibly tell yet what is "not working", because we have seen only one small function. It is hard to say whether even that function does what it logically should.
What is "not working"? No button? No change in ui->textResult on click? Unexpected result? Crash? Fails to compile?
Ok so I have a hospital and there are some rooms... so I made buttons as a rooms.. and when I click on that button I can write temperature and humidity (in the "Text edit") and after this when I know temperature and humidity I can calculate HeatIndex... so how to make code ???
when I click on that button I can write temperature and humidity
What?
That implies that clicking that button is connected to a code that will show a separate dialog that contains (text edit) widgets. In other words that button is not directly involved in any calcuation.
Btw, why "text edit"? There are QSpinBox, QDoubleSpinBox, and QLineEdit widgets. If the input values are numeric, then use a widget that enforces the property.