![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
QT
竹a艟
C/C++
Python
Shell
展开
-
QT 中的异常捕获
用了QT很长时间,一直就发现QT有个很无语的地方就是它的异常捕获不能用,简单的除0异常都捕获不了,try{int n=0;qDebug()<<1/n;}catch(...){QMessageBox(QMessageBox::Warning, QString::fromLocal8Bit("警告"), QString::fromLocal8Bit("除数不能为0")).exec();}总是进不去catch,找了很多文章也没搞明白,今天偶然回头,发现早有解决方法,只是原创 2021-04-13 17:10:21 · 13295 阅读 · 5 评论 -
QMessageBox自定义按钮内容
QMessageBox mess(QMessageBox::Information, tr("提醒"), tr("xxxxx")); QPushButton *button1= (mess.addButton(tr("text1"), QMessageBox::AcceptRole)); QPushButton *button2= (mess.add...原创 2019-08-26 11:21:01 · 2304 阅读 · 0 评论