I'm trying to change the background color of the QLineEdit
and I can't figure it out at all.
I tried using stylesheets
originally like this
QLineEdit *le = new QLineEdit();
le->setStyleSheet("background:#000;");
but that didn't do anything. I tried using QPalette
like this
QPalette palette;
palette.setColor(QPalette::Base, Qt::black);
palette.setColor(QPalette::Background, Qt::black);
le.setPalette(palette);
but this didn't do anything either. I've been looking all day and can't find anything. am I doing something wrong or is there another way to do it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…