Results 1 to 2 of 2

Thread: QWizardPage

  1. #1
    Join Date
    Mar 2010
    Posts
    107
    Thanks
    22
    Qt products
    Qt4
    Platforms
    Windows

    Default QWizardPage

    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


    Qt Code:
    1. bool CreateFieldJobElevationsAndReceiversPage::validate()
    2. {
    3. bool returnValue = true;
    4. QString errors = QString();
    5. QString toolSystemZeroedText = ui.toolSystemZeroedComboBox->currentText();
    6. if (ui.toolSystemZeroedComboBox->currentText() == "<Not Set>")
    7. {
    8. errors += "Tool System not set";
    9. errors.append (QString("\n"));
    10.  
    11. returnValue = false;
    12. }
    13. if (ui.depthOffsetLineEdit->text().length() == 0)
    14. {
    15. errors += "Depth Offset Missing";
    16. errors.append (QString("\n"));
    17. returnValue = false;
    18. }
    19.  
    20.  
    21. if (ui.receiverSpacingLineEdit->text().length() == 0)
    22. {
    23. errors += "Receiver Spacing Missing";
    24. errors.append (QString("\n"));
    25. returnValue = false;
    26. }
    27.  
    28. if (!returnValue)
    29. {
    30. qDebug() << errors;
    31. setSubTitle(QString("<font color=red>") + errors + QString("</font>"));
    32. qDebug() << "new " << subTitle();
    33. }
    34. return returnValue;
    35. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QWizardPage

    as can be seen here:
    http://doc.qt.nokia.com/latest/qwiza...-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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. [Help]: How to make a QWizardPage unvisited?
    By dongli in forum Qt Programming
    Replies: 3
    Last Post: 13th July 2014, 18:41
  2. Replies: 4
    Last Post: 11th September 2013, 17:32
  3. Qt Designer Cannot add controls to QWizardPage
    By 27Loco in forum Qt Tools
    Replies: 1
    Last Post: 17th July 2010, 22:58
  4. [Help]: How to make a QWizardPage unvisited?
    By dongli in forum Qt Tools
    Replies: 1
    Last Post: 29th June 2009, 15:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.