我想查看QMessageBox按钮的背景颜色和字体? 任何帮助将不胜感激。
答案 0 :(得分:1)
#include <QtWidgets>
int main(int argc,char* argv[])
{
QApplication app(argc,argv);
QMessageBox msgBox(QMessageBox::Information,
"QMessageBox Background Color",
"This is QMessageBox with Different Background Color");
//Change background color
QPalette palette;
palette.setColor(QPalette::Background, Qt::cyan);
msgBox.setPalette(palette);
//Change font
QFont font( "Tokyo" );
font.setPointSize( 32 );
font.setWeight( QFont::Bold );
font.setItalic( TRUE );
msg->setFont(font);
msg->exec();
msgBox.show();
return app.exec();
}
的更多信息