summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui.pro1
-rw-r--r--src/gui/painting/qpainter.cpp10
-rw-r--r--src/gui/text/qstatictext.cpp5
3 files changed, 11 insertions, 5 deletions
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index cbdbb5c..b22f732 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -41,6 +41,7 @@ include(math3d/math3d.pri)
include(effects/effects.pri)
contains(QT_CONFIG, egl): include(egl/egl.pri)
+win32:!wince*: DEFINES += QT_NO_EGL
embedded: QT += network
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 7b5fcc2..898a996 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5844,6 +5844,11 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
QStaticTextPrivate *staticText_d =
const_cast<QStaticTextPrivate *>(QStaticTextPrivate::get(&staticText));
+ if (font() != staticText_d->font) {
+ staticText_d->font = font();
+ staticText_d->needsRelayout = true;
+ }
+
// If we don't have an extended paint engine, or if the painter is projected,
// we go through standard code path
if (d->extended == 0 || !d->state->matrix.isAffine()) {
@@ -5880,11 +5885,6 @@ void QPainter::drawStaticText(const QPointF &topLeftPosition, const QStaticText
staticTextNeedsReinit = true;
}
- if (font() != staticText_d->font) {
- staticText_d->font = font();
- staticTextNeedsReinit = true;
- }
-
// Recreate the layout of the static text because the matrix or font has changed
if (staticTextNeedsReinit)
staticText_d->init();
diff --git a/src/gui/text/qstatictext.cpp b/src/gui/text/qstatictext.cpp
index 45252d8..5f31ef0 100644
--- a/src/gui/text/qstatictext.cpp
+++ b/src/gui/text/qstatictext.cpp
@@ -584,6 +584,11 @@ void QStaticTextPrivate::paintText(const QPointF &topLeftPosition, QPainter *p)
textLayout.draw(p, topLeftPosition);
} else {
QTextDocument document;
+ QColor color = p->pen().color();
+ document.setDefaultStyleSheet(QString::fromLatin1("body { color: #%1%2%3 }")
+ .arg(QString::number(color.red(), 16), 2, QLatin1Char('0'))
+ .arg(QString::number(color.green(), 16), 2, QLatin1Char('0'))
+ .arg(QString::number(color.blue(), 16), 2, QLatin1Char('0')));
document.setDefaultFont(font);
document.setDocumentMargin(0.0);
if (textWidth >= 0.0)