Your problem lies in the constructor in 47-49 lines
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&)));
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&)));
To copy to clipboard, switch view to plain text mode
Replace with these:
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&)));
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&)));
To copy to clipboard, switch view to plain text mode
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...
Bookmarks