Solved An Easy Answer For An Old Hand
-
This is probably the silliest question on the planet -
But when my user enters a value into a spin box - how do I make sure it comes as only an int? I need to perform math on it ... and I am so new - the help docs help a little - but very cryptic in the beginning.
So basically - What I have is below. I can pull values from the GUI no problem - but I want the value to be an integer.
void MainWindow::on_spinBox_valueChanged(const QString)
{
QString days;
days=ui->spinBox->text();
} -
@ShylerC You can use the other slot for that
void QSpinBox::valueChanged(int i)
-
@ShylerC
you should take your time and take a look at the documentation of Qtit's is very detailed and in 90% off all case has the answer to your questions
for example:
-
Hi
- This is probably the silliest question on the planet
Oh no, not even close. :)
Anyway, just want to say that
QString also have
http://doc.qt.io/qt-5/qstring.html#toInt
and toDouble
for such conversations in case other time there
is not a signal with the right type. - This is probably the silliest question on the planet