I am trying to have the user upload a file to the application on one QWizardPage, and then be able to re-use that same file path on another QWizardPage. However, from my code
class ExecutePage(QtWidgets.QWizardPage):
def __init__(self,*args,**kwargs):
super().__init__()
def initializePage(self):
self.setTitle("Choose file to execute")
self.setSubTitle("Please choose a file to execute")
self.myTextBox = QtWidgets.QTextEdit(self)
self.myTextBox.setGeometry(QtCore.QRect(100, 0, 350, 50))
self.uploader = QtWidgets.QPushButton("upload",self)
self.uploader.clicked.connect(self.get_file_name)
def get_file_name(self):
self.name = QtWidgets.QFileDialog.getOpenFileName(self.uploader,'Choose File to Run')[0]
self.registerField("file_name",self.name,"currentText")
class ConclusionPage(QtWidgets.QWizardPage):
def __init__(self,*args,**kwargs):
super().__init__()
def initializePage(self):
self.setSubTitle(self.field("file_name"))
I am getting an error
TypeError: registerField(self,str,QWidget,property: str = None, changedSignal: PYQT_SIGNAL = 0): argument 2 has unexpected type 'str'
Is there a simple way to convert this specific string (self.name) into a QWidget that is able to be passed onto other pages in the Wizard (i.e. in this example, onto the subtitle field in the Conclusion Page)?
I've looked through the documentation but can't figure it out so would appreciate a few pointers. Thanks.