If I were you, I would be writing something like this:
confirmationpage.cpp
#include <QString>
#include <QSpinBox>
#include <QList>
#include <QLabel>
...
void ConfirmationPage::displaySpinBoxNameValues()
{
QString myText;
// Get the spinboxes from your tab.
// Use pointer anywhere here if you use that
foreach (SpinBox spinbBox, SpinBoxList) {
if (spinBox.value() > 0) {
myText.append(QString("Name: ") + spinBox.text());
myText.append(QString("\tValue: ") + spinBox.value());
myText.append('\n');
}
}
if (myText.isEmpty())
myText.append("No QSpinBox has value greater than zero!\n");
// Could be a QLabel, etc.
myDisplayWidget.setText(myText);
}
...
You would need the following method documentations to understand the methods used for this: