Updating Value of Registered Field between QWizardPages



  • I am creating a QWizard that requires exchanging a QString (well, I would rather like to have an abitraty object) between the pages and subsequently extending this QString.

    In one QWizardPage, I use the following code in its constructor:

        CommandField = new QLineEdit(this);
        CommandField->setVisible(false);
        registerField("Command", CommandField);
    

    and the following code to set some text in the CommandField in a slot that is called by some user intaction:

     CommandField->setText("UsefulCommand");
    

    Note that I don't want this to be shown to the user, hence the setVisible(false) in the constructor, but I see no way to share data without using a suitable QWidget.

    Anyway at some other QWizardPage visited by the user, I need to extend the data (text) that is stored in the field and hence, I though of using the following code:

    field("Command").setValue(field("Command").toString() + " MoreStuff");
    

    However, this last piece of code has no effect. Does anybody have a suggestion how I can either

    • Update the text stored to the field("Command"), or
    • Have somehow direct access to objects in different QWizardPages


  • Well, I looked at it for an hour and 1 minute after typing this message, I found the solution. I should have used:

    setFied("Command", field("Command").toString() + " MoreStuff");
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.