Hi,
I'm new to Qt and C++ so I'm asking questions about this problem to learn and test my knowledge. Unfortunately I don't have the "for sure" answer.
I'm not familiar with the book you are using. Does it have you modify the ui_... .h file?
I would try uncommenting the slot declarations in the dialog.h file, then add the slot functions to the dialog.cpp file e.g.
Dialog
::void decChanged
(const QString &newValue
) {
bool ok;
int num = newValue.toInt(&ok);
if (ok) {
hexEdit
->setText
(QString::number(num,
16));
binEdit
->setText
(QString::number(num,
2));
} else {
hexEdit->setText("0");
binEdit->setText("0");
}
}
Dialog::void decChanged (const QString &newValue)
{
bool ok;
int num = newValue.toInt(&ok);
if (ok) {
hexEdit->setText(QString::number(num, 16));
binEdit->setText(QString::number(num, 2));
} else {
hexEdit->setText("0");
binEdit->setText("0");
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks