I think you do not properly construct runtime_error your custom exception class derived from. You need simple do the following:
class myExceptions : public runtime_error
{
public:
myExceptions(const char *msg) : runtime_error(msg) {};
~myExceptions() throw();
};
You do not need to implement what() function, because it is already implemented in runtime_error class. I would also catch the specific exception type:
try {
MyClass2 myClass2(param);
} catch (const myExceptions &e) {
QMessageBox::critical(&window, "title", e.what());
}