Hi, I have completed a temperature conversion C++ program. It gave me the correct converted amounts when I use lineEdit but when I use a QDoubleSpinBox it gives the result of "32 F" every time.
How can I let the QDoubleSpinBox give me the correct result? I am using Qt Creator
I have not used Qt Creator, but if you are always getting 32 as your output, that appears to mean that your celsius variable is always 0.0. Which then means that your strCelsius.toDouble() call is most likely failing.
So the first thing I would do is use a debugger and put a breakpoint at line 21, to examine the value of strCelsius before it is converted into a double.
You can also pass a bool by pointer as a parameter to the toDouble function, and this value will be filled with true for success, false for failure. https://doc.qt.io/qt-5/qstring.html#toDouble
@keskiverto i don't use text, the program accepts double values (temperature) in celsius and should print the converted Fahrenheit value in the QMessageBox