1. 程式人生 > >qlineedit設定背景顏色

qlineedit設定背景顏色

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);