drhex
18th November 2006, 10:26
Here is a small prog that just sets a color and some text in a QTextEdit.
(QT 4.2 on X11)
#include <QApplication>
#include <QTextEdit>
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QTextEdit t;
qDebug("init color: %08x", t.textColor().rgb());
t.setTextColor(0xdd9933);
qDebug("after set color: %08x", t.textColor().rgb());
t.setPlainText("Some text");
qDebug("after set text: %08x", t.textColor().rgb());
t.show();
app.exec();
return 0;
}
The console output is:
init color: ff000000
after set color: ffdd9933
after set text: ff000000
Apparently, setting the text has the side-effect of resetting the current color. Looks like a bug to me. Anyone who can interpret it as a "feature"?
(QT 4.2 on X11)
#include <QApplication>
#include <QTextEdit>
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QTextEdit t;
qDebug("init color: %08x", t.textColor().rgb());
t.setTextColor(0xdd9933);
qDebug("after set color: %08x", t.textColor().rgb());
t.setPlainText("Some text");
qDebug("after set text: %08x", t.textColor().rgb());
t.show();
app.exec();
return 0;
}
The console output is:
init color: ff000000
after set color: ffdd9933
after set text: ff000000
Apparently, setting the text has the side-effect of resetting the current color. Looks like a bug to me. Anyone who can interpret it as a "feature"?