Version: 4.1.80 (using Devel) OS: Linux Installed from: Compiled sources The text color of the notes plasmoid won't change after setting it to a custom color, it always uses the default plasma color.
In trunk this bug still exists when you change color BEFORE writing any text. If you write some text then change color, the new color is applied. If you don't have any text and set a custom color, it is not applied. It might be a QGraphicsProxyWidget bug as the paint event gives me the new color.
I have a test case for it: I made a minimum app with a QTextEdit and below it, a QTextEdit as QGraphicsProxyWidget. Both are without any text, both have setTextColor(QColor(Qt::red)); set. Enter some text in both, top one (normal QTextEdit) has text in red, WoC stays with text black. To build: qmake -project && qmake && make #include <QApplication> #include <QVBoxLayout> #include <QGraphicsScene> #include <QGraphicsView> #include <QGraphicsProxyWidget> #include <QTextEdit> int main( int argc, char ** argv ) { QApplication a( argc, argv ); QWidget window; window.resize(400, 250); //normal QTextEdit QVBoxLayout *layout = new QVBoxLayout; QTextEdit *textWidget1 = new QTextEdit; layout->addWidget(textWidget1); textWidget1->setTextColor(QColor(Qt::red)); // ** input some text it'll be red //QtextEdit with WoC QTextEdit *textWidget2 = new QTextEdit; QGraphicsView *view = new QGraphicsView; QGraphicsScene *scene = new QGraphicsScene; view->setScene(scene); QGraphicsProxyWidget *proxy = scene->addWidget(textWidget2); textWidget2->setTextColor(QColor(Qt::red)); // ** input some text, it'll stay black layout->addWidget(view); textWidget1->show(); window.setLayout(layout); view->show(); window.show(); return a.exec(); }
It's a bit worse... If you change color after writing text, and then delete all text, it returns black.
I think it's the same text case than the one above: setTextColor() is not applied in the WoC when there is no text.
The bug is fixed upstream but this doesnot work yet on the plasmoid. Attempted patch at http://reviewboard.kde.org/r/679/ A bit ugly but the timer has to be skipped for it to work.
SVN commit 1014374 by darioandres: - When the text is deleted the format will always reverted to zero; as KTextEdit calls only work on local/selected text, but they won't set a "default" format. - To fix this, I adapted the patch by anmma at http://reviewboard.kde.org/r/679/ - On "lineChange", detect if the character entered is the first one (that means the previous text (if any) was deleted) and set the default char text format to use the defined font style/size/family and foreground color. So, the global format/style settings will be always honored - Do not change the QPalette of the KTextEdit as this is not needed anymore (was it needed before?) BUG: 176266 M +8 -6 notes.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1014374
SVN commit 1014389 by darioandres: Backport to 4.3 of: SVN commit 1014374 by darioandres: - When the text is deleted the format will always reverted to zero; as KTextEdit calls only work on local/selected text, but they won't set a "default" format. - To fix this, I adapted the patch by anmma at http://reviewboard.kde.org/r/679/ - On "lineChange", detect if the character entered is the first one (that means the previous text (if any) was deleted) and set the default char text format to use the defined font style/size/family and foreground color. So, the global format/style settings will be always honored - Do not change the QPalette of the KTextEdit as this is not needed anymore (was it needed before?) and: SVN commit 1014384 by darioandres: - Simplify the code to selectAll+change some text property - On "updateTextGeometry" it is not necessary to set the font family again. - Set the font family only on "configAccepted" (if the font was changed) - Fix a bug in the following workflow: - Text written, deleted, widget resized, text written again will have the previous size (calculated before the "updateTextGeometry" call). That is why we need to call "lineChanged" again CCBUG: 176266 M +18 -21 notes.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1014389