You have to create a constructor in the code of the MainWindow class. There already is one taking a QWidget pointer as a parameter. Add another (or extend the one that is already there) that takes the parameters you want. This is basic C++!