Qt Creator: accessing an object not defined in the source files
-
I have a .ui file that looks like this:
http://img521.imageshack.us/img521/9753/nol.png
Upon one of the QCheckBoxes being ticked, I want Generated Command Line Preview to update itself. Here's the particular code I'm trying to work with:
@
void Dialog::on_inputformatCombo_currentIndexChanged(const QString &arg1)
{
commandline.insert(commandline.length(),arg1);
CLIPreview.setText(commandline);
}
@
However, the dialog.cpp and dialog.h files are bare and don't make any mention of the objects I created in the .ui file. How am I supposed to access CLIPreview then? -
This wildly depends on how you are including your UI header (upon compilation, uic generates ui_yourdialog.h file).
If your dialog was generated automatically by Qt Creator, then most probably you need to use:
@
ui->CLIPreview->setText("blah");
@