Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Accessing elements of QWizardPage created by QWizard in QT Designer

    General and Desktop
    3
    6
    1178
    Loading More Posts
    • 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.
    • T
      tesmai4 last edited by

      I created a QWizard[call it MyQWizard] and added some pages into it QWizardPage [MyQWizardPage-1, MyQWizardPage-2]

      I added comboBox on MyQWizardPage-1 and need to access fit form my code. How can I do that?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        What would you like to do with that combo box ?

        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 Reply Quote 0
        • T
          tesmai4 last edited by

          Thanks for your reply. I need to access the selected value from the combobox.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Where do you want to access that value ?

            From another 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 Reply Quote 0
            • dheerendra
              dheerendra Qt Champions 2022 last edited by

              Assuming that your fourth page is wiz4 of type QWizardPage. Items are added to page as children. You can do the following to get it.

              QComboBox *box1 = wiz4->findChild<QComboBox*>();
              box1->addItem("tesmai4");
              

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                I wouldn't recommend findChild for that use case. A properly written widget can provide the needed information.

                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 Reply Quote 0
                • First post
                  Last post