yes it work full example
@#include <QtGui/QApplication>
#include <QWidget>
#include <QTextEdit>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget w;
QTextEdit *txtEdit = new QTextEdit(&w);
// to change backgournd color
txtEdit->setStyleSheet("background-color: rgb(255, 1, 255)");
// to reset it to default color ...
txtEdit->setStyleSheet("");
w.show();
return a.exec();
}
@