From d45908e24292a41ff7838366b34be7340bf9fda5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 26 Mar 2019 12:48:36 +0100 Subject: Support missing white-space:pre-line CSS A mode that only preserves new lines. Change-Id: I612347b181c6e6c41dfae0cf60b22a662cba1b7e Reviewed-by: Lars Knoll --- src/gui/text/qcssparser.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gui/text/qcssparser.cpp') diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index b5489c7ed9..45f1ca596e 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -222,6 +222,7 @@ static const QCssKnownValue values[NumKnownValues - 1] = { { "outset", Value_Outset }, { "overline", Value_Overline }, { "pre", Value_Pre }, + { "pre-line", Value_PreLine }, { "pre-wrap", Value_PreWrap }, { "ridge", Value_Ridge }, { "right", Value_Right }, @@ -248,10 +249,10 @@ static const QCssKnownValue values[NumKnownValues - 1] = { }; //Map id to strings as they appears in the 'values' array above -static const short indexOfId[NumKnownValues] = { 0, 41, 48, 42, 49, 54, 35, 26, 70, 71, 25, 43, 5, 63, 47, - 29, 58, 59, 27, 51, 61, 6, 10, 39, 56, 19, 13, 17, 18, 20, 21, 50, 24, 46, 67, 37, 3, 2, 40, 62, 16, - 11, 57, 14, 32, 64, 33, 65, 55, 66, 34, 69, 8, 28, 38, 12, 36, 60, 7, 9, 4, 68, 53, 22, 23, 30, 31, - 1, 15, 0, 52, 45, 44 }; +static const short indexOfId[NumKnownValues] = { 0, 41, 48, 42, 49, 50, 55, 35, 26, 71, 72, 25, 43, 5, 64, 48, + 29, 59, 60, 27, 52, 62, 6, 10, 39, 56, 19, 13, 17, 18, 20, 21, 51, 24, 46, 68, 37, 3, 2, 40, 63, 16, + 11, 58, 14, 32, 65, 33, 66, 56, 67, 34, 70, 8, 28, 38, 12, 36, 61, 7, 9, 4, 69, 54, 22, 23, 30, 31, + 1, 15, 0, 53, 45, 44 }; QString Value::toString() const { -- cgit v1.2.3 From d8a9bec35fb0c60a0e5990c1a12ffe6f39fdbf2d Mon Sep 17 00:00:00 2001 From: Nils Jeisecke Date: Thu, 17 Dec 2015 16:38:15 +0100 Subject: QTextDocument: add css-styling of table cell borders to HTML import/export Supported style attributes: style: supports "border-collapse: collapse" and "border-color". border: width of the outer border bordercolor: basic color for all borders style: not supported
/ style: supports the "border", "border-[top|left|bottom|right]]" shorthand styles and the "border-width", "border-color" and "border-style" (and the top/left/bottom/right variants) attributes will render a simple 1px table grid. Notes: The QTextDocument table model is much simpler than the HTML table model. It basically only has
and and
support. So the HTML parser is forced to map markup and styling to the QTextDocument model which is not without loss. In other words: While QTextDocument -> HTML -> QTextDocument should preserve the QTextDocument structure, HTML -> QTextDocument -> HTML does not preserve the HTML DOM at all. So for now the HTML importer and writer only support border styles on the and nodes. In future updates, the HTML parser might be enhanced to map
CSS styles to the cells. Change-Id: If9e7312fa6cbf270cf8f7b3c72ba1fa094107517 Reviewed-by: Shawn Rutledge --- src/gui/text/qcssparser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gui/text/qcssparser.cpp') diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 45f1ca596e..0b2dedf5dc 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -92,6 +92,7 @@ static const QCssKnownValue properties[NumProperties - 1] = { { "border-bottom-right-radius", BorderBottomRightRadius }, { "border-bottom-style", BorderBottomStyle }, { "border-bottom-width", BorderBottomWidth }, + { "border-collapse", BorderCollapse }, { "border-color", BorderColor }, { "border-image", BorderImage }, { "border-left", BorderLeft }, @@ -1732,6 +1733,14 @@ void Declaration::borderImageValue(QString *image, int *cuts, *h = *v; } +bool Declaration::borderCollapseValue() const +{ + if (d->values.count() != 1) + return false; + else + return d->values.at(0).toString() == QLatin1String("collapse"); +} + QIcon Declaration::iconValue() const { if (d->parsed.isValid()) -- cgit v1.2.3 From 9b14950ff600a4ce5a8698b67ab38907c50417f1 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 9 Jul 2019 10:34:31 +0300 Subject: Android: Update clang mkspecs Follow Google's BuildSystemMaintainers doc to simplify (a lot) the clang support It is needed to support future NDK releases painlessly. Also remove old workarounds. [ChangeLog][Android] Android depends on NDK r20+ Change-Id: Ib4c07fc71e0f5a264d804b0b3baa18ff79d07630 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qcssparser.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/gui/text/qcssparser.cpp') diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 0b2dedf5dc..ce7c7610c1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -612,11 +612,7 @@ bool ValueExtractor::extractBorder(int *borders, QBrush *colors, BorderStyle *st case BorderRightStyle: styles[RightEdge] = decl.styleValue(); break; case BorderStyles: decl.styleValues(styles); break; -#ifndef QT_OS_ANDROID_GCC_48_WORKAROUND case BorderTopLeftRadius: radii[0] = sizeValue(decl); break; -#else - case BorderTopLeftRadius: new(radii)QSize(sizeValue(decl)); break; -#endif case BorderTopRightRadius: radii[1] = sizeValue(decl); break; case BorderBottomLeftRadius: radii[2] = sizeValue(decl); break; case BorderBottomRightRadius: radii[3] = sizeValue(decl); break; -- cgit v1.2.3