HEllo people,
I am following the book of qt4-the art of building qt applications..the below problem is of a byte converter ..but there is a logical error ...please help me rectify it...files uploaded.
Thanks
Printable View
HEllo people,
I am following the book of qt4-the art of building qt applications..the below problem is of a byte converter ..but there is a logical error ...please help me rectify it...files uploaded.
Thanks
What kind of logical error?
You just try to run the program...you yourselves will find it..there is some problem with the code....but i cant figure it out.........
Your problem lies in the constructor in 47-49 lines
Code:
connect(decEdit, SIGNAL(textChanged(const QString&)),this, SLOT(decChanged(const QString&))); connect(hexEdit, SIGNAL(textChanged(const QString&)),this, SLOT(hexChanged(const QString&))); connect(binEdit, SIGNAL(textChanged(const QString&)),this, SLOT(binChanged(const QString&)));
Replace with these:
Code:
connect(decEdit, SIGNAL(textEdited(const QString&)),this, SLOT(decChanged(const QString&))); connect(hexEdit, SIGNAL(textEdited(const QString&)),this, SLOT(hexChanged(const QString&))); connect(binEdit, SIGNAL(textEdited(const QString&)),this, SLOT(binChanged(const QString&)));
The difference is the signal that the lineEdit emits.
textEdit(...) isn't emitted when you call setText(), but textChanged(...) does. So your problem was everytime
you setText() in your class's slots the textChanged(...) signal was called again and again...
By The Way ...where is the option to delete posts...i am not able to see it
Thanks
Well thanks,
It started working....But could you please provide some more details.....i am a noob with Line edits.,.....basically what is textchanged and texedited?
Thanks
A very detailed description of QLineEdit is here http://doc.qt.nokia.com/4.6/qlineedit.html :D