setupUi() is automatically generated, don't change it because next time you run uic on the .ui file your changes will be overwritten. Initialize the private member in class constructor.