Hi
I am setting the subtitle of a QWizard page with the following code. The idea is to build a list of missing data and report this via the subtitle. The code half works - I see the errors but they are not separated by the new line characters in the string. The qDebug statements do have the newlines.
Can the sub title part of the wizard page contain a multi line string?
TIA Graham
bool CreateFieldJobElevationsAndReceiversPage::validate()
{
bool returnValue = true;
QString toolSystemZeroedText
= ui.
toolSystemZeroedComboBox->currentText
();
if (ui.toolSystemZeroedComboBox->currentText() == "<Not Set>")
{
errors += "Tool System not set";
returnValue = false;
}
if (ui.depthOffsetLineEdit->text().length() == 0)
{
errors += "Depth Offset Missing";
returnValue = false;
}
if (ui.receiverSpacingLineEdit->text().length() == 0)
{
errors += "Receiver Spacing Missing";
returnValue = false;
}
if (!returnValue)
{
qDebug() << errors;
setSubTitle
(QString("<font color=red>") + errors
+ QString("</font>"));
qDebug() << "new " << subTitle();
}
return returnValue;
}
bool CreateFieldJobElevationsAndReceiversPage::validate()
{
bool returnValue = true;
QString errors = QString();
QString toolSystemZeroedText = ui.toolSystemZeroedComboBox->currentText();
if (ui.toolSystemZeroedComboBox->currentText() == "<Not Set>")
{
errors += "Tool System not set";
errors.append (QString("\n"));
returnValue = false;
}
if (ui.depthOffsetLineEdit->text().length() == 0)
{
errors += "Depth Offset Missing";
errors.append (QString("\n"));
returnValue = false;
}
if (ui.receiverSpacingLineEdit->text().length() == 0)
{
errors += "Receiver Spacing Missing";
errors.append (QString("\n"));
returnValue = false;
}
if (!returnValue)
{
qDebug() << errors;
setSubTitle(QString("<font color=red>") + errors + QString("</font>"));
qDebug() << "new " << subTitle();
}
return returnValue;
}
To copy to clipboard, switch view to plain text mode
Bookmarks