0

I have created a wizard in Qt Designer. I would like one of the pages to be populated with variable information, depending on what data was provided in previous wizard pages. From the Qt documentation, I see the information to initialize with C++, but I can't determine how to do it with Python.

I've found this but again, it's C++. I tried using the Promote Widget... command in Qt Designer, but it asks for the class and header, so again, I don't see how to use it for Python.

I found this for Python, but it appears to be a manually created Qt Wizard, rather than one created with Qt Designer.

I tried using self.wizardPage.initialize(), which should work, but I couldn't figure out how to "populate" that method without rewriting the entire class for that page. And assuming I did that, I couldn't figure out how to insert that new class into the wizard.

I looked at created a new Wizard Page in my Python code, with the intention of overriding the existing page in the Wizard, but had no success with that. Do I just have to hand-code the wizard and forego Qt Designer?

crystalattice
  • 5,031
  • 12
  • 40
  • 57
  • please provide a [mre] – eyllanesc Jan 04 '21 at 15:18
  • It completely depends on *what* you need to "initialize". If you need simple things, such as to disable a button when a checkbox is toggled, use the internal signal/slot tool of designer, otherwise you need to do it by code, and the designer ui is only used as a "skeleton". – musicamante Jan 04 '21 at 15:20
  • You have 2 tasks: 1) Create a custom QWizardPage where initialize method is overrided and as you already pointed out there is already a post that covers this topic, 2) promote a widget (the QWizardPage) written in python in Qt Designer and I have already added several posts that implement that logic – eyllanesc Jan 04 '21 at 15:27
  • @musicamante That was actually useful information. Thanks. – crystalattice Jan 04 '21 at 20:02
  • Self-answer: Everything else was too complicated, I discovered. Simply using `self.button(QWizard.NextButton).clicked.connect(self.desired_method)` keeps everything within the Wizard, with all object accessible. Referencing the precursor objects to populate the wizard page works just fine. – crystalattice Jan 04 '21 at 20:57

0 Answers0