From f050f2180ffb8298de802b33ad9f017312df1815 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Sat, 6 Aug 2016 17:02:31 +0300 Subject: Describe meaning of typographic units in QRawFont documentation Text is copied from corresponding QFontMetrics methods. Change-Id: Ife79e0d1b06ca3f691f2fd8bd796b41aeaa76954 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qrawfont.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/gui') diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp index 9e045f91c3..66d16d6068 100644 --- a/src/gui/text/qrawfont.cpp +++ b/src/gui/text/qrawfont.cpp @@ -310,6 +310,13 @@ bool QRawFont::operator==(const QRawFont &other) const /*! Returns the ascent of this QRawFont in pixel units. + The ascent of a font is the distance from the baseline to the + highest position characters extend to. In practice, some font + designers break this rule, e.g. when they put more than one accent + on top of a character, or to accommodate an unusual character in + an exotic language, so it is possible (though rare) that this + value will be too small. + \sa QFontMetricsF::ascent() */ qreal QRawFont::ascent() const @@ -320,6 +327,11 @@ qreal QRawFont::ascent() const /*! Returns the descent of this QRawFont in pixel units. + The descent is the distance from the base line to the lowest point + characters extend to. In practice, some font designers break this rule, + e.g. to accommodate an unusual character in an exotic language, so + it is possible (though rare) that this value will be too small. + \sa QFontMetricsF::descent() */ qreal QRawFont::descent() const @@ -330,6 +342,8 @@ qreal QRawFont::descent() const /*! Returns the xHeight of this QRawFont in pixel units. + This is often but not always the same as the height of the character 'x'. + \sa QFontMetricsF::xHeight() */ qreal QRawFont::xHeight() const @@ -340,6 +354,8 @@ qreal QRawFont::xHeight() const /*! Returns the leading of this QRawFont in pixel units. + This is the natural inter-line spacing. + \sa QFontMetricsF::leading() */ qreal QRawFont::leading() const -- cgit v1.2.3 From 29205c53e46fb2fc9f8063a46fd5ef5e9be532db Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 31 Aug 2016 09:36:34 +0200 Subject: QWindowPrivate::maybeQuitOnLastWindowClosed(): Skip tooltips Windows of type Qt::ToolTip should not prevent closing the application when checking for the last window. Task-number: QTBUG-55523 Change-Id: I47c51abe79bf6c857aba229960de95e1a23efb10 Reviewed-by: J-P Nurmi --- src/gui/kernel/qwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index bcd29b6fe1..2ff19f5175 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2357,7 +2357,7 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed() bool lastWindowClosed = true; for (int i = 0; i < list.size(); ++i) { QWindow *w = list.at(i); - if (!w->isVisible() || w->transientParent()) + if (!w->isVisible() || w->transientParent() || w->type() == Qt::ToolTip) continue; lastWindowClosed = false; break; -- cgit v1.2.3 From d95cb94baa6302bea6ad57a9690453e9b618421e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 22 Sep 2016 17:04:29 +0200 Subject: Fix linear RGB16 gradients Writing to solid overwrites part of the gradient input messing up later lines. In particular repeating gradients tended to be broken. Tested by lancelot (once the baseline is correct). Change-Id: I64222048ba67b0424b44822f09ddc947973145a6 Reviewed-by: Eirik Aavitsland Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qdrawhelper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index ee3863ceb8..39ff4142b8 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5638,15 +5638,16 @@ static void qt_gradient_quint16(int count, const QSpan *spans, void *userData) int yinc = int((linear.dy * data->m22 * gss) * FIXPT_SIZE); int off = int((((linear.dy * (data->m22 * qreal(0.5) + data->dy) + linear.off) * gss) * FIXPT_SIZE)); - QRgba64 oldColor = data->solid.color; + // Save the fillData since we overwrite it when setting solid.color. + QGradientData gradient = data->gradient; while (count--) { int y = spans->y; - data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&data->gradient, yinc * y + off)); + data->solid.color = QRgba64::fromArgb32(qt_gradient_pixel_fixed(&gradient, yinc * y + off)); blend_color_rgb16(1, spans, userData); ++spans; } - data->solid.color = oldColor; + data->gradient = gradient; } else { blend_src_generic(count, spans, userData); -- cgit v1.2.3