Qt Set Background Color of QLineEdit

前端 未结 4 1100

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 th

4条回答
  •  醉梦人生
    2020-12-18 21:19

    I had to use background-color from standard css like this:

    QLineEdit* edit = new QLineEdit();
    edit->setStyleSheet("QLineEdit {background-color: black;}");
    

    I am using Qt 5.4

提交回复
热议问题