Jean-Marc Lasgouttes wrote:
"Bo Peng" <[EMAIL PROTECTED]> writes:

 #if QT_VERSION >= 0x040200
-       item->setForeground(0, QBrush(color));
-       item->setForeground(1, QBrush(color));
+       item->setForeground(0, QBrush(QColor(color)));
+       item->setForeground(1, QBrush(QColor(color)));
 #else
        item->setTextColor(0, QColor(color));
        item->setTextColor(1, QColor(color));
As long as it compiles, put it in. JMarc uses 4.1 so he only tested
setText(QColor(color)). I used QBrush("black") etc before.

So the QBrush constructor can take a char const * as parameter but not
a QString? That is braindead!

You are probably confused, QBrush doesn't take a QString nor a char *, it needs a QColor. But QColor can take both:

QColor ( const QString & name )
QColor ( const char * name )

Abdel.

Reply via email to