使用QPalette的方法不行,

 

ui->le_text->setAutoFillBackground(true);
qDebug() << ui->le_text->palette().color(QPalette::WindowText);
QPalette lette;
QColor color(50,0,255, 255);
lette.setColor(QPalette::WindowText, color);
ui->le_text->setPalette(lette);
qDebug() << ui->le_text->palette().color(QPalette::WindowText);

 

需要使用stylesheet的方法。

ui->le_text->setStyleSheet("background-color:rgba(0,255,255,255)");

 

http://blog.csdn.net/zhi379/article/details/12842455

相关文章:

  • 2022-12-23
  • 2021-08-14
  • 2021-10-07
  • 2022-02-09
  • 2022-12-23
  • 2021-07-10
  • 2022-02-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-20
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案