How to pass object to procedure
General and Desktop
3
Posts
2
Posters
815
Views
1
Watching
-
I want a procedure. I want to pass ComboBox object name to it.
@void MainWindow::addPowerUnitTypes(QComboBox *ComboBox)
{
ui->ComboBox->addItem("kilowatt [kW]");
ui->ComboBox->addItem("horsepower [hp, hp (UK)]");
}@And call the function
@addPowerUnitTypes(ui->comboBoxFrom);@But I get an error: mainwindow.h:27: error: 'QComboBox' has not been declared.
The line 27 of mainwindow.h is
@void addPowerUnitTypes(QComboBox*);@I am totally new to this. I am Delphi programmer.