Problem with Qtextedit?
-
This is NOT a problem of QTextEdit. Styles are inherited automatically. To avoid this, you can use "selectors":http://doc.qt.nokia.com/4.7/stylesheet-syntax.html#selector-types
-
Notice that,
@
QMainWindow w;
w.setStyleSheet("QPushButton { background:#F0F;}");
@
will affect all the push buttons from main window.For instance:
@QMainWindow w;
w.setStyleSheet("QWidget #menuBar QPushButton{ background:#F0F;}");@
will affect only push buttons from the QWidget named as menuBar.You should use "selectors":http://doc.qt.nokia.com/4.7/stylesheet-syntax.html#selector-types as Rahul said. Its very important in UI creation.