PDA

View Full Version : text rendering problem



vno4697
12th August 2008, 15:44
I'm trying to render blue text on the Dense4Pattern background of black and white color.
Rendered text is not solid, there are gaps in characters.

Following is the constructor of the widget:


QLabel* pLabel = new QLabel(QString::fromUtf8(textPtr), this);

QPalette backgroundPalette;
QBrush windowBrush = QBrush(Qt::black);
windowBrush .setStyle(Qt::SolidPattern);
backgroundPalette.setBrush(QPalette::Window, windowBrush);
QBrush baseBrush = QBrush(Qt:white);
baseBrush .setStyle(Qt::Dense4Pattern);
backgroundPalette.setBrush(QPalette::Base, baseBrush);
this->setPalette(backgroundPalette);

QPalette textPalette;
QBrush textBrush = QBrush(Qt::blue);
textBrush.setStyle(Qt::SolidPattern);
textPalette.setBrush(QPalette::WindowText, textBrush);
pLabel->setPalette(textPalette);

Does anybody know what is the problem and how it can be solved?
Thanks in advance for your help.