Plus you need to have a

connect(ui->btnCreateFile, SIGNAL(pressed()), this, SLOT(CreateFile()));

line in the constructor of your CustomSlot class.