I just call static function like the following:
QMessageBox::warning(this, tr("My App"), tr("Please select files to copy."), MessageBox::Ok);