Not only that, but if you are constructing the MyDialog instance on the stack in main() *before* calling app.exec(), then you *still* don't have an event loop running at the point the constructor code is executing.Your "mp" is a variable on the stack of the MyDialog constructor. It will be destroyed once the constructor ends.
Add a button to your dialog and a slot in which you execute the play code. Connect the button's clicked() signal to this slot in the MyDialog constructor.
Bookmarks