[Solved] How to restore QTextEdit original background color?
-
or u can set it in code like this:
@ this->ui->textEdit->setStyleSheet("background-color: rgb(255, 255, 255)");
@ -
[quote author="MuhamedAuda" date="1351790408"]or u can set it in code like this: @ this->ui->textEdit->setStyleSheet("background-color: rgb(255, 255, 255)"); @[/quote]
That is not my point. What you refer to as rgb(255,255,255) will give "White" color.
But my original QTextEdit color is not white. -
i think the default background color OS color base ...
-
[quote author="MuhamedAuda" date="1351790782"]i think the default background color OS color base ...[/quote]
Yes, I agree. It's OS dependent.
That's why I want to know how to restore it back to its original color after I change it?
I thought I need to know the original color in order to restore it. Or maybe there's another way to do this.
-
[quote author="Jake007" date="1351791872"]I'm glad I could help :) . Please mark topic as solved ( edit your first post and add [Solved] in front of the title). Regards, Jake[/quote]
Done! Thanks, Jake :)
Btw, do you happen to know the solution for my other question? (QTextEdit cursor)?
-
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();
}
@