mardi 4 août 2015

QT How to read a ComboBox from a different source?

In my main.cpp I set an identifier using a combo box. In a different source.cpp I want to be able to read the current value in the combo box. I've tried...

Ui::MainWindow->comboBox->currentText();

but that just gives me the error...

expected primary-expression before '->' token
     QString identifier =  Ui::MainWindow->comboBox->currentText();

What am I missing? Was I supposed to define Ui::MainWindow in my header file? Or is their a better way of doing this? Thanks

Aucun commentaire:

Enregistrer un commentaire