Yes, there is a way.
All widgets must be created after the QApplication instance.
Qt Code:
  1. #include <QPushButton>
  2.  
  3. ...
  4. This is where you create the application
  5. ...
  6. QPushButton btn("Temporary button", NULL);
  7. btn.show();
  8. ...
  9. This is the part where you call exec.
To copy to clipboard, switch view to plain text mode 
This should do it.
Regards