Hi all,
I have written a set of code which is conversion of binary ,decimal and hexa..
the code works fine for conversion of a decimal number into binary and hex,but it doesnt work for binary and hex conversion...the code for dec conversion is
1, bool ok;
2, int num= newValue.toInt(&ok);
3, if (ok) {
4, hexEdit->setText(QString::number(num, 16));
5, binEdit->setText(QString::number(num, 2));
6, } else {
7, hexEdit->setText("");
8 ,binEdit->setText("");
if the same thing is done with hex in this way it doesnt work
1, bool ok;
2, int num= newValue.toInt(&ok);
3, if (ok) {
4, decEdit->setText(QString::number(num,10));
5, binEdit->setText(QString::number(num, 2));
6, } else {
7, binEdit->setText("");
8, decEdit->setText("");
i think the problem lies in line 4 or 5 .....any other function or idea would be helpful !!