0
我试图为我的消息设置边框,但它不起作用。你们能指出问题出在哪里吗?如何在QMessageBox中为消息设置边框?
QMessageBox msg(this);
msg.setWindowModality(Qt::WindowModal);
msg.setWindowTitle(QLatin1String("Notice"));
msg.setTextFormat(Qt::RichText);
msg.setText("<html><head/><body><p>The reason of error is :</p><p><span style=\"border : 1px solid;\"><i> There is no data </i></span></p></body></html>");
msg.setStandardButtons(QMessageBox::Ok);
msg.setIcon(QMessageBox::Icon::Warning);
msg.exec();
这是结果,斜体的作品,但边界不起作用。
谢谢。我试图使用'border-style',但它不起作用。而且我不知道如何为边框设置像素,没有'border-width'。 – gnase
是的,我也考虑过这个问题,但我仍然不知道如何在msg中添加标签 – gnase
@gnase,您可以继承QDialog''来创建自己的''MessageBox' ' –