PDA

View Full Version : QTextEdit and style sheets



roxton
13th September 2008, 13:39
Hello! I'm trying to customize QTextEdit colors via the stylesheet:



textEdit->setStyleSheet ("color: " + text_color + "; background-color: " + back_color +
"; selection-color: " + sel_text_color + "; selection-background-color: " + sel_back_color + ";");


text_color, back_color, etc. are QString variables. The colors are change, but the QTextEdit's scrollbar becomes unusable - the scrollbar receives just single clicks, no drag'n'drop of the scroller pointer, and it looks like it has no visual style at all.

jpn
13th September 2008, 13:50
Use a type selector to exclude scroll bars:
textEdit->setStyleSheet("QTextEdit { ... }");

roxton
13th September 2008, 14:33
It works! Thank you!