Thanks! Nice article and solution.
Qt Code:
  1. void MyGlWidget::initializeGL() {
  2. try {
  3. throw std::exception();
  4. } catch(...) {
  5. getExceptionMessage(&exception_msg_);
  6. QMessageBox *msgbox = new QMessageBox(QMessageBox::Warning,
  7. "Exception",
  8. exception_msg_,
  9. this);
  10. msgbox->open(0, 0);
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 
Don't forget to use "new QMessageBox", because "QMessageBox msgbox;" will be deleted on scope exit. open() doesn't block the execution.