调整 QMessageBox 中的窗口标志、名称和中心按钮(Qt/C++)

调整 QMessageBox 中的窗口标志、名称和中心按钮(Qt/C++)

我正在尝试调整 QMessageBox,但不知何故我没有找到任何有关如何正确处理出现的消息框的 WindowLogo 和名称的信息。将按钮“ok”水平居中会更好。 到目前为止,我的代码(Qt/C++)以及解决 MessageBox 窗口图标和名称的方法:

// just for the color understanding
const QColor BG_COLOR = QColor(125,125,125);
QString setColorBG = "{background: rgb("
           + QString::number(BG_COLOR.red())   + ","
           + QString::number(BG_COLOR.green()) + ","
           + QString::number(BG_COLOR.blue())  + ");}";

QMessageBox msg;
msg.setText("Please select images.");
msg.setIcon(QMessageBox::Warning);
msg.setWindowIcon(QIcon()); // has no effect
msg.setWindowIconText("Warning"); // has no effect
msg.setStyleSheet("QMessageBox QPushButton{background: rgb(173,173,173);}"
                  "QMessageBox " + setColorBG);
msg.exec();

当前阅读“PanoramaCreator”的文本及其旁边的徽标是否可以通过类似的方法进行处理,或者是否需要完全不同的内容?

guodongjie05 回答:调整 QMessageBox 中的窗口标志、名称和中心按钮(Qt/C++)

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/29110.html

大家都在问