Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Updating Value of Registered Field between QWizardPages
Forum Updated to NodeBB v4.3 + New Features

Updating Value of Registered Field between QWizardPages

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 516 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ModelTechM Offline
    ModelTechM Offline
    ModelTech
    wrote on last edited by ModelTech
    #1

    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
    1 Reply Last reply
    0
    • ModelTechM Offline
      ModelTechM Offline
      ModelTech
      wrote on last edited by
      #2

      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");
      
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved