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. QWizard, How pass information from QWizard to QWizardPage
QtWS25 Last Chance

QWizard, How pass information from QWizard to QWizardPage

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.0k Views
  • 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.
  • M Offline
    M Offline
    marceloarguello700
    wrote on last edited by marceloarguello700
    #1

    Hi i am making a wizard to import text files,it is almost finished.
    I know how to register field and share between Pages
    void QWizardPage::registerField(etc..
    Also know how retrieve the value when the wizard finish

    void TextImportWizard::accept()
    {     qDebug() <<"ImportWizard::accept:";
          m_filename = field("reg_filename").toString();
        qDebug() <<"m_filename:"<< m_filename;
    }
    

    My problem is that registerField is memeber of QWizardPage,
    I need to register in the QWizard class
    Need to set the filename that will be open on the firts page.
    The QWizard class receive the filename,
    myWizard.setFilename(filename);
    Now i need to share the filename with the first QWizardPage.
    and the QWizard class dont have registerField method?
    So how can do?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      QWizard is a QWidget so you could register the wizard itself but if it's only to give an information to the first page why not just have a setFilename also on your first page ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        marceloarguello700
        wrote on last edited by
        #3

        Thanks for the reply but
        I still do not understand
        registerField is a QWizardPage method, the Qwizard only can read field
        QVariant QWizard::field(const QString & name) const

        my chain action is:
        filename to=> QWizard then to=> QWizardPage

        You say to add a method setFilename to the QWizardPage
        If do that, now how get access to page method from the QWizard.
        also before the void QWizardPage::initializePage()

        Can you provide a code snip.
        Greetings

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If you add a property to your QWizard derived class, you can call registerField on it like you do for any widget inside your QWizardPage

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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