I want the QtextEdit in my application to be green, so I set the stylesheet
background-color: rgb(109, 255, 99);
However, this also changes the background color of the scroll bars and even when I press the right mouse button in text mode, the menu displayed is also green, and this is not what I expected.
I use Qt Designer to create a gui, and then I used uic to create a C ++ file.
in a C ++ file is as follows:
textEdit->setAutoFillBackground(false);
textEdit->setStyleSheet(QString::fromUtf8("background-color: rgb(109, 255, 99);"));
textEdit->setReadOnly(true);
Does anyone know how to set the background color only for the area where the text will be?
thank
source
share