Например такой код:
void myfunk (void)
{
...
}
//-----------------
int main(int argc, char *argv[])
{
QPushButton *btnPath = new QPushButton("Open");
QVBoxLayout *layout = new QVBoxLayout;
....
layout->addWidget(btnPath);
wgt.setLayout(layout);
wgt.show();
}