程序如下,请高手指教,谢谢
QPalette pal1 = ui->pushButton_1->palette();
pal1.setColor(QPalette::ButtonText,QColor(255,0,0));
setPalette(pal1);
------解决方案--------------------
多看看Manual:
Warning: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for both the Windows XP, Windows Vista, and the Mac OS X styles.
Style sheets let you perform all kinds of customizations that are difficult or impossible to perform using QPalette alone