简体   繁体   English

Qt std :: runtime_error等效

[英]Qt std::runtime_error equivalent

Does Qt have a class equivalent to std::runtime_error (like QString is equivalent to std::string )? Qt是否有一个等同于std::runtime_error的类(例如QString等同于std::string )?

Specifically, std::runtime_error holds a string describing the error, so you can just do: 具体来说, std::runtime_error包含描述错误的字符串,因此您可以执行以下操作:

throw std::runtime_error("my error description");

不,Qt不使用异常(除了QtConcurrent :: Exception以外,它跨线程引发和捕获异常。)仅使用标准的C ++异常类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM