Retrieve hexadecimal values from QLineEdit
Solved
General and Desktop
-
I want to be able to retrieve a user inputted hexadecimal number and put it into a variable from a QLineEdit. I have:
uint data_str = this->ui->lineEdit_3->text().toUInt();
But when evaluating what data_str holds, it will return 0 every time. Does anyone know how if I typed 0x30 into the LineEdit, the data_str would hold a value of 48?
Doing:
QString data_str = this->ui->lineEdit_3->text(); uint d = data_str.toUInt();
Retruns a value of 0 as well.
-
@rtvideo said in Retrieve hexadecimal values from QLineEdit:
Does anyone know how if I typed 0x30 into the LineEdit, the data_str would hold a value of 48?
Yes, fix your use of QString::toUInt()