PDA

View Full Version : QWizardPage



GrahamLabdon
28th April 2011, 10:29
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 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;
}

high_flyer
29th April 2011, 12:08
as can be seen here:
http://doc.qt.nokia.com/latest/qwizard.html#elements-of-a-wizard-page
Multiline subtitles should not be a problem.
Since they can also be rich text/html, this also would indicate multiline is possible.
It looks to me that you are using html - so try using html break lines (<br>), or don't use html with regular break lines.