6#include <QtCore/qmap.h>
18#ifndef QT_NO_CSSPARSER
28#include "qcssscanner.cpp"
133 {
"position", Position },
230static const short indexOfId[
NumKnownValues] = { 0, 41, 48, 42, 49, 50, 55, 35, 26, 71, 72, 25, 43, 5, 64, 48,
231 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,
232 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,
233 1, 15, 0, 53, 45, 44 };
343 if ((prop ==
end) || (
name < *prop))
350 switch (propertyId) {
377: declarations(decls), adjustment(0), fontExtracted(
false), pal(pal)
397 data.number =
s.toDouble();
409int ValueExtractor::lengthValue(
const Declaration &decl)
411 if (decl.
d->parsed.isValid())
413 if (decl.
d->values.size() < 1)
416 decl.
d->parsed = QVariant::fromValue<LengthData>(
data);
422 if (decl.
d->parsed.isValid()) {
425 for (
int i = 0;
i < 4;
i++)
432 for (
i = 0;
i <
qMin(decl.
d->values.size(), 4);
i++)
433 datas[
i] = lengthValue(decl.
d->values[
i]);
437 datas[0] = datas[1] = datas[2] = datas[3] =
zero;
439 datas[3] = datas[2] = datas[1] = datas[0];
449 for (
i = 0;
i < 4;
i++) {
450 v += QVariant::fromValue<LengthData>(datas[
i]);
460 for (
int i = 0;
i < declarations.size();
i++) {
462 switch (decl.
d->propertyId) {
463 case Width: *
w = lengthValue(decl);
break;
464 case Height: *
h = lengthValue(decl);
break;
482 for (
int i = 0;
i < declarations.size();
i++) {
484 switch (decl.
d->propertyId) {
485 case Left: *
left = lengthValue(decl);
break;
486 case Top: *
top = lengthValue(decl);
break;
487 case Right: *
right = lengthValue(decl);
break;
505 for (
int i = 0;
i < declarations.size();
i++) {
507 switch (decl.
d->propertyId) {
532 for (
int i = 0;
i < declarations.size();
i++) {
542 if (decl.
d->parsed.isValid()) {
549 if (decl.
d->values.size() > 0)
550 x[0] = lengthValue(decl.
d->values.at(0));
551 if (decl.
d->values.size() > 1)
552 x[1] = lengthValue(decl.
d->values.at(1));
556 v << QVariant::fromValue<LengthData>(
x[0]) << QVariant::fromValue<LengthData>(
x[1]);
563 radii[0] = sizeValue(decl);
564 for (
int i = 1;
i < 4;
i++)
573 for (
int i = 0;
i < declarations.size();
i++) {
575 switch (decl.
d->propertyId) {
632 for (
int i = 0;
i < declarations.size();
i++) {
634 switch (decl.
d->propertyId) {
663 Qt::Alignment
a[2] = { { }, { } };
687 v.variant.convert(QMetaType::fromType<QColor>());
692 return qvariant_cast<QColor>(
v.variant);
704 const QString &identifier = lst.at(0);
715 const bool hsl = !
rgb && !hsv && identifier.
startsWith(
"hsl"_L1);
717 if (!
rgb && !hsv && !hsl)
720 const bool hasAlpha = identifier.
size() == 4 && identifier.
at(3) == u
'a';
729 if (!
p.parseExpr(&colorDigits))
731 const int tokenCount = colorDigits.
size();
733 for (
int i = 0;
i <
qMin(tokenCount, 7);
i += 2) {
735 const qreal maxRange = (
rgb ||
i != 0) ? 255. : 359.;
736 colorDigits[
i].variant = colorDigits.
at(
i).variant.toReal() * (maxRange / 100.);
748 qWarning(
"QCssParser::parseColorValue: Specified color with alpha value but no alpha given: '%s'",
qPrintable(lst.join(u
' ')));
752 qWarning(
"QCssParser::parseColorValue: Specified color without alpha value but alpha given: '%s'",
qPrintable(lst.join(u
' ')));
756 int v1 = colorDigits.
at(0).variant.toInt();
757 int v2 = colorDigits.
at(2).variant.toInt();
758 int v3 = colorDigits.
at(4).variant.toInt();
760 if (tokenCount == 7) {
761 int alphaValue = colorDigits.
at(6).variant.toInt();
763 alpha = colorDigits.
at(6).variant.toReal() * 255.;
802 gradFuncs <<
"qlineargradient"_L1 <<
"qradialgradient"_L1 <<
"qconicalgradient"_L1 <<
"qgradient"_L1;
805 if ((gradType = gradFuncs.indexOf(lst.at(0).toLower())) == -1)
813 spreads <<
"pad"_L1 <<
"reflect"_L1 <<
"repeat"_L1;
815 bool dependsOnThePalette =
false;
835 dependsOnThePalette =
true;
842 spread = spreads.indexOf(
value.variant.toString());
844 vars[attr] =
value.variant.toReal();
859 if (dependsOnThePalette)
867 vars.
value(
"fy"_L1));
873 if (dependsOnThePalette)
885 if (dependsOnThePalette)
905 switch (
v.variant.toInt()) {
940 if (decl.
d->parsed.isValid()) {
952 if (decl.
d->values.isEmpty())
956 data.width.number = 0;
962 data.width = lengthValue(decl.
d->values.at(
i));
964 if (++
i >= decl.
d->values.size()) {
965 decl.
d->parsed = QVariant::fromValue<BorderData>(
data);
973 if (++
i >= decl.
d->values.size()) {
974 decl.
d->parsed = QVariant::fromValue<BorderData>(
data);
984 decl.
d->parsed = QVariant::fromValue<BorderData>(
data);
994 for (
int i = 0;
i <
values.size(); ++
i) {
997 *
image =
v.variant.toString();
1009 *repeat = repeatAttempt;
1038 for (
int i = 0;
i < declarations.size(); ++
i) {
1040 if (decl.
d->values.isEmpty())
1043 switch (decl.
d->propertyId) {
1052 if (decl.
d->parsed.isValid()) {
1053 *repeat =
static_cast<Repeat>(decl.
d->parsed.toInt());
1057 decl.
d->parsed = *repeat;
1070 if (decl.
d->parsed.isValid()) {
1074 *repeat =
data.repeat;
1082 decl.
d->parsed = QVariant::fromValue<BackgroundData>(
data);
1100 switch (
value.variant.toInt()) {
1101 case Value_Small: *fontSizeAdjustment = -1;
break;
1106 default: valid =
false;
break;
1118 if (
value.variant.convert(QMetaType::fromType<qreal>())) {
1125 if (
value.variant.convert(QMetaType::fromType<int>())) {
1137 switch (
value.variant.toInt()) {
1150 switch (
value.variant.toInt()) {
1162 switch (
value.variant.toInt()) {
1185 bool shouldAddSpace =
false;
1191 shouldAddSpace =
false;
1200 shouldAddSpace =
true;
1204 if (families.isEmpty())
1212 for (
int i = 0;
i <
values.size(); ++
i) {
1215 switch (
values.at(
i).variant.toInt()) {
1264 *fontSizeAdjustment = -255;
1288 switch (
value.variant.toInt()) {
1299 switch (
value.variant.toInt()) {
1308bool ValueExtractor::extractFont(
QFont *
font,
int *fontSizeAdjustment)
1310 if (fontExtracted) {
1312 *fontSizeAdjustment = adjustment;
1313 return fontExtracted == 1;
1317 for (
int i = 0;
i < declarations.size(); ++
i) {
1319 if (decl.
d->values.isEmpty())
1322 switch (decl.
d->propertyId) {
1340 adjustment = *fontSizeAdjustment;
1341 fontExtracted = hit ? 1 : 2;
1346 QBrush *selectedForeground,
1347 QBrush *selectedBackground,
1348 QBrush *alternateBackground,
1349 QBrush *placeHolderTextForeground,
1353 for (
int i = 0;
i < declarations.size(); ++
i) {
1355 switch (decl.
d->propertyId) {
1369void ValueExtractor::extractFont()
1374 extractFont(&
f, &dummy);
1380 for (
int i = 0;
i < declarations.size(); ++
i) {
1382 switch (decl.
d->propertyId) {
1385 if (decl.
d->values.size() > 0 && decl.
d->values.at(0).type ==
Value::Uri) {
1387 QImageReader imageReader(decl.
d->values.at(0).variant.toString());
1388 if ((*
size = imageReader.size()).isNull()) {
1391 *
size = imageReader.read().size();
1406 const auto declaration = std::find_if(
1407 declarations.rbegin(), declarations.rend(),
1408 [](
const Declaration &decl) { return decl.d->propertyId == QtIcon; });
1409 if (declaration == declarations.rend())
1412 *
icon = declaration->iconValue();
1415 if (declaration->d->values.isEmpty())
1418 const auto &propertyValue = declaration->d->values.constFirst();
1423 const QString url(propertyValue.variant.toString());
1425 *
size = imageReader.size();
1426 if (!
size->isNull())
1430 *
size = imageReader.read().size();
1438 if (
d->values.size() != 1)
1441 if (
d->parsed.isValid()) {
1442 switch (
d->parsed.typeId()) {
1443 case qMetaTypeId<QColor>():
1444 return qvariant_cast<QColor>(
d->parsed);
1445 case qMetaTypeId<int>():
1447 case qMetaTypeId<QList<QVariant>>():
1448 if (
d->parsed.toList().size() == 1) {
1449 auto parsedList =
d->parsed.toList();
1450 const auto &
value = parsedList.at(0);
1451 return qvariant_cast<QColor>(
value);
1459 d->parsed = QVariant::fromValue<int>(
color.role);
1462 d->parsed = QVariant::fromValue<QColor>(
color.color);
1469 if (
d->values.size() != 1)
1472 if (
d->parsed.isValid()) {
1473 if (
d->parsed.userType() == QMetaType::QBrush)
1474 return qvariant_cast<QBrush>(
d->parsed);
1475 if (
d->parsed.userType() == QMetaType::Int)
1482 d->parsed = QVariant::fromValue<int>(
data.role);
1486 d->parsed = QVariant::fromValue<QBrush>(
data.brush);
1493 int needParse = 0x1f;
1496 if (
d->parsed.isValid()) {
1500 for (
i = 0;
i <
qMin(
v.size(), 4);
i++) {
1501 if (
v.at(
i).userType() == QMetaType::QBrush) {
1502 c[
i] = qvariant_cast<QBrush>(
v.at(
i));
1503 }
else if (
v.at(
i).userType() == QMetaType::Int) {
1506 needParse |= (1<<
i);
1510 if (needParse != 0) {
1512 for (
i = 0;
i <
qMin(
d->values.size(), 4);
i++) {
1513 if (!(needParse & (1<<
i)))
1517 v += QVariant::fromValue<int>(
data.role);
1521 v += QVariant::fromValue<QBrush>(
data.brush);
1528 if (needParse & 0x10)
1532 else if (
i == 1)
c[3] =
c[2] =
c[1] =
c[0];
1533 else if (
i == 2)
c[2] =
c[0],
c[3] =
c[1];
1534 else if (
i == 3)
c[3] =
c[1];
1539 if (
d->values.size() != 1)
1541 const Value &
v =
d->values.at(0);
1550 s.chop(unitStr.
size());
1569 s.chop(unitStr.
size());
1580 if (
d->values.size() != 1)
1587 if (
d->parsed.isValid())
1588 return qvariant_cast<QSize>(
d->parsed);
1590 int x[2] = { 0, 0 };
1591 const int count =
d->values.size();
1594 qWarning(
"QCssParser::sizeValue: Too many values provided");
1597 const auto &
value =
d->values.at(
i);
1603 x[
i] = (
x[
i] * 72) / 96;
1612 d->parsed = QVariant::fromValue<QSize>(
size);
1618 if (
d->values.size() != 1)
1621 if (
d->parsed.isValid())
1622 return qvariant_cast<QRect>(
d->parsed);
1628 if (
func.size() != 2 ||
func.at(0).compare(
"rect"_L1) != 0)
1634 d->parsed = QVariant::fromValue<QRect>(
rect);
1641 if (
d->parsed.isValid()) {
1643 for (
i = 0;
i <
qMin(
d->values.size(), 4);
i++) {
1644 if (
v.at(
i).userType() == QMetaType::QColor) {
1645 c[
i] = qvariant_cast<QColor>(
v.at(
i));
1652 for (
i = 0;
i <
qMin(
d->values.size(), 4);
i++) {
1655 v += QVariant::fromValue<int>(
color.role);
1658 v += QVariant::fromValue<QColor>(
color.color);
1666 else if (
i == 1)
c[3] =
c[2] =
c[1] =
c[0];
1667 else if (
i == 2)
c[2] =
c[0],
c[3] =
c[1];
1668 else if (
i == 3)
c[3] =
c[1];
1673 if (
d->values.size() != 1)
1681 for (
i = 0;
i <
qMin(
d->values.size(), 4);
i++)
1684 else if (
i == 1)
s[3] =
s[2] =
s[1] =
s[0];
1685 else if (
i == 2)
s[2] =
s[0],
s[3] =
s[1];
1686 else if (
i == 3)
s[3] =
s[1];
1691 if (
d->parsed.isValid())
1692 return static_cast<Repeat>(
d->parsed.toInt());
1693 if (
d->values.size() != 1)
1698 return static_cast<Repeat>(
v);
1703 if (
d->parsed.isValid())
1704 return static_cast<Origin>(
d->parsed.toInt());
1705 if (
d->values.size() != 1)
1710 return static_cast<Origin>(
v);
1715 if (
d->parsed.isValid())
1717 if (
d->values.size() != 1)
1727 if (
d->parsed.isValid())
1728 return static_cast<Attachment>(
d->parsed.toInt());
1729 if (
d->values.size() != 1)
1740 if (
d->parsed.isValid())
1741 return d->parsed.toInt();
1743 for (
int i = 0;
i <
d->values.size();
i++) {
1744 features |=
static_cast<int>(
findKnownValue(
d->values.value(
i).variant.toString(),
1747 d->parsed = features;
1753 if (
d->values.isEmpty() ||
d->values.at(0).type !=
Value::Uri)
1755 return d->values.at(0).variant.toString();
1760 if (
d->parsed.isValid())
1761 return Qt::Alignment(
d->parsed.toInt());
1762 if (
d->values.isEmpty() ||
d->values.size() > 2)
1775 for (
int i = 0;
i < 4;
i++)
1779 if (
d->values.size() < 2)
1784 for (
i = 0;
i <
qMin(
d->values.size()-1, 4);
i++) {
1785 const Value&
v =
d->values.at(
i+1);
1788 cuts[
i] =
v.variant.toString().toInt();
1790 if (
i == 0) cuts[0] = cuts[1] = cuts[2] = cuts[3] = 0;
1791 else if (
i == 1) cuts[3] = cuts[2] = cuts[1] = cuts[0];
1792 else if (
i == 2) cuts[2] = cuts[0], cuts[3] = cuts[1];
1793 else if (
i == 3) cuts[3] = cuts[1];
1810 if (
d->values.size() != 1)
1813 return d->values.at(0).toString() ==
"collapse"_L1;
1818 if (
d->parsed.isValid())
1819 return qvariant_cast<QIcon>(
d->parsed);
1822 for (
int i = 0;
i <
d->values.size();) {
1829 for (
int j = 0;
j < 2;
j++) {
1831 switch (
d->values.at(
i).variant.toInt()) {
1852 if (
i ==
d->values.size())
1859 d->parsed = QVariant::fromValue<QIcon>(
icon);
1874 val += sel.
ids.size() * 0x100;
1900 *negated |= pseudo.
type;
1913 for (
int j = 0;
j <
rule.selectors.size(); ++
j) {
1916 if (
selector.basicSelectors.isEmpty())
1920 if (
selector.basicSelectors.size() != 1)
1922 }
else if (
selector.basicSelectors.size() <= 1) {
1928 if (!sel.
ids.isEmpty()) {
1947 if (!universalsSelectors.
isEmpty()) {
1976 if (
selector.basicSelectors.isEmpty())
1980 if (
selector.basicSelectors.size() != 1)
1982 return basicSelectorMatches(
selector.basicSelectors.at(0), node);
1984 if (
selector.basicSelectors.size() <= 1)
1987 int i =
selector.basicSelectors.size() - 1;
1993 match = basicSelectorMatches(sel, node);
1995 if (
i ==
selector.basicSelectors.size() - 1)
2020 node = previousSibling;
2034bool StyleSelector::basicSelectorMatches(
const BasicSelector &sel, NodePtr node)
2047 switch (
a.valueMatchCriterium) {
2051 if (attrValue !=
a.value)
2057 for (
auto s : lst) {
2068 const QString dashPrefix =
a.value + u
'-';
2069 if (attrValue !=
a.value && !attrValue.
startsWith(dashPrefix))
2093 if (!sel.
ids.isEmpty()
2103 for (
int j = 0;
j <
rule.selectors.size(); ++
j) {
2105 if (selectorMatches(
selector, node)) {
2110 if (
rule.selectors.size() > 1) {
2131 for (
int sheetIdx = 0; sheetIdx <
styleSheets.size(); ++sheetIdx) {
2137 if (!styleSheet.
idIndex.isEmpty()) {
2139 for (
int i = 0;
i <
ids.size();
i++) {
2143 matchRule(node,
it.value(), styleSheet.
origin, styleSheet.
depth, &weightedRules);
2150 for (
int i = 0;
i <
names.size();
i++) {
2156 matchRule(node,
it.value(), styleSheet.
origin, styleSheet.
depth, &weightedRules);
2164 for (
int j = 0;
j < styleSheet.
mediaRules.at(
i).styleRules.size(); ++
j) {
2166 styleSheet.
depth, &weightedRules);
2187 for (
int i = 0;
i < rules.
size();
i++) {
2192 decls += rules.
at(
i).declarations;
2200 decls += rules.
at(
i).declarations;
2207 return (
c >=
'0' &&
c <=
'9')
2208 || (
c >=
'a' &&
c <=
'f')
2209 || (
c >=
'A' &&
c <=
'F')
2217 if (hasEscapeSequences)
2218 *hasEscapeSequences =
false;
2227 const int hexStart =
i;
2234 if (hexCount == 0) {
2235 if (hasEscapeSequences)
2236 *hasEscapeSequences =
true;
2240 hexCount =
qMin(hexCount, 6);
2244 output.replace(hexStart - 1, hexCount + 1, code);
2272 int tok = scanner.
lex();
2279 tok = scanner.
lex();
2288 for (
int i = 0;
i <
len; ++
i) {
2316 styleSheet =
stream.readAll();
2318 qWarning() <<
"QCss::Parser - Failed to load file " << css;
2439 media->append(
lexem());
2480 default:
prev();
break;
2507 decl->
d->property =
lexem();
2529 const int declarationStart =
index;
2534 const int rewind =
index;
2538 const int semicolonIndex =
index;
2540 index = declarationStart;
2543 if (foundSemicolon && semicolonIndex <
index) {
2545 index = semicolonIndex - 1;
2594 basicSel->
ids.append(theid);
2599 a.name =
"class"_L1;
2614 if (onceMore) ++
count;
2616 return count >= minCount;
2631 default:
return false;
2703 const int rewind =
index;
2719 declaration->
d->important =
true;
2761 bool haveUnary =
false;
2774 value->variant.convert(QMetaType::fromType<double>());
2786 if (haveUnary)
return false;
2793 if (haveUnary)
return false;
2798 value->variant = theid;
2803 if (haveUnary)
return false;
2809 value->variant = col;
2813 if (
name ==
"url"_L1) {
2857 qWarning(
"QCssParser::parseHexColor: Unknown color name '%s'",
lexem().toLatin1().constData());
2866 const int rewind =
index;
2935 case LBRACE: ++braceCount;
break;
2936 case LBRACKET: ++brackCount;
break;
2938 case LPAREN: ++parenCount;
break;
2945 case LBRACE: ++braceCount;
break;
2946 case RBRACE: --braceCount;
break;
2947 case LBRACKET: ++brackCount;
break;
2948 case RBRACKET: --brackCount;
break;
2950 case LPAREN: ++parenCount;
break;
2951 case RPAREN: --parenCount;
break;
2960 if (braceCount < 0 || brackCount < 0 || parenCount < 0) {
2970 if (!
test(
t))
return false;
QChar toLower() const noexcept
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
The QColor class provides colors based on RGB, HSV or CMYK values.
static QColor fromRgb(QRgb rgb) noexcept
Static convenience function that returns a QColor constructed from the given QRgb value rgb.
static QColor fromString(QAnyStringView name) noexcept
static QColor fromHsv(int h, int s, int v, int a=255)
Static convenience function that returns a QColor constructed from the HSV color values,...
static QColor fromHsl(int h, int s, int l, int a=255)
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
bool parsePseudoPage(QString *selector)
bool parseFunction(QString *name, QString *args)
bool until(TokenType target, TokenType target2=NONE)
bool parseSelector(Selector *sel)
bool parseSimpleSelector(BasicSelector *basicSel)
bool parseRuleset(StyleRule *styleRule)
bool parsePage(PageRule *pageRule)
void init(const QString &css, bool file=false)
bool testTokenAndEndsWith(TokenType t, QLatin1StringView str)
bool parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity=Qt::CaseSensitive)
bool testSimpleSelector()
bool parseCombinator(BasicSelector::Relation *relation)
bool parseNextOperator(Value *value)
bool parseNextMedium(QStringList *media)
bool parseMedium(QStringList *media)
const Symbol & symbol() const
QString unquotedLexem() const
bool parsePseudo(Pseudo *pseudo)
bool parseClass(QString *name)
bool parseProperty(Declaration *decl)
bool parseMedia(MediaRule *mediaRule)
bool parseNextExpr(QList< Value > *values)
bool parseNextSelector(Selector *sel)
bool parseAttrib(AttributeSelector *attr)
bool parseTerm(Value *value)
QString lexemUntil(TokenType t)
bool parseNextDeclaration(Declaration *declaration)
bool lookupElementName() const
bool testAndParseUri(QString *uri)
bool parseExpr(QList< Value > *values)
bool parseElementName(QString *name)
bool parseHexColor(QColor *col)
bool parsePrio(Declaration *declaration)
bool parseImport(ImportRule *importRule)
static QString preprocess(const QString &input, bool *hasEscapeSequences=nullptr)
static void scan(const QString &preprocessedInput, QList< Symbol > *symbols)
virtual NodePtr parentNode(NodePtr node) const =0
virtual QStringList nodeNames(NodePtr node) const =0
virtual bool nodeNameEquals(NodePtr node, const QString &nodeName) const
virtual NodePtr previousSiblingNode(NodePtr node) const =0
virtual void freeNode(NodePtr node) const =0
virtual bool hasAttributes(NodePtr node) const =0
virtual bool isNullNode(NodePtr node) const =0
QList< StyleSheet > styleSheets
virtual NodePtr duplicateNode(NodePtr node) const =0
virtual QString attributeValue(NodePtr node, const QCss::AttributeSelector &aSelector) const =0
Qt::CaseSensitivity nameCaseSensitivity
virtual QStringList nodeIds(NodePtr node) const
QList< StyleRule > styleRulesForNode(NodePtr node)
QList< Declaration > declarationsForNode(NodePtr node, const char *extraPseudo=nullptr)
\inmodule QtCore \reentrant
QString absolutePath() const
Returns a file's path absolute path.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
\reentrant \inmodule QtGui
int height() const
Returns the height of the font.
int xHeight() const
Returns the 'x' height of the font.
void setStyle(Style style)
Sets the style of the font to style.
void setOverline(bool)
If enable is true, sets overline on; otherwise sets overline off.
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
void setFamilies(const QStringList &)
void setCapitalization(Capitalization)
void setWordSpacing(qreal spacing)
void setLetterSpacing(SpacingType type, qreal spacing)
void setKerning(bool)
Enables kerning for this font if enable is true; otherwise disables it.
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
void setPointSizeF(qreal)
Sets the point size to pointSize.
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
void setWeight(Weight weight)
Sets the weight of the font to weight, using the scale defined by \l QFont::Weight enumeration.
void setSpread(Spread spread)
Specifies the spread method that should be used for this gradient.
void setCoordinateMode(CoordinateMode mode)
void setStops(const QGradientStops &stops)
Replaces the current set of stop points with the given stopPoints.
Spread
Specifies how the area outside the gradient area should be filled.
T value(const Key &key) const noexcept
The QIcon class provides scalable icons in different modes and states.
void addPixmap(const QPixmap &pixmap, Mode mode=Normal, State state=Off)
Adds pixmap to the icon, as a specialization for mode and state.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
Mode
This enum type describes the mode for which a pixmap is intended to be used.
State
This enum describes the state for which a pixmap is intended to be used.
The QImageReader class provides a format independent interface for reading images from files or other...
constexpr qsizetype size() const noexcept
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void prepend(rvalue_ref t)
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator constEnd() const
iterator insert(const Key &key, const T &value)
const_iterator constBegin() const
The QPalette class contains color groups for each widget state.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
\inmodule QtCore\reentrant
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
void chop(qsizetype n)
Removes n characters from the end of the string.
void clear()
Clears the contents of the string and makes it null.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString toLower() const &
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
auto tokenize(Needle &&needle, Flags...flags) const &noexcept(noexcept(qTokenize(std::declval< const QString & >(), std::forward< Needle >(needle), flags...))) -> decltype(qTokenize(*this, std::forward< Needle >(needle), flags...))
qreal toReal(bool *ok=nullptr) const
Returns the variant as a qreal if the variant has userType() \l QMetaType::Double,...
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
QSet< QString >::iterator it
const quint64 PseudoClass_Unknown
const quint64 PseudoClass_Floatable
const quint64 PseudoClass_Movable
const quint64 PseudoClass_Children
const quint64 PseudoClass_Disabled
const quint64 PseudoClass_Sibling
const quint64 PseudoClass_ReadOnly
const quint64 PseudoClass_Closed
const quint64 PseudoClass_Maximized
const quint64 PseudoClass_Default
const quint64 PseudoClass_Bottom
const quint64 PseudoClass_EditFocus
const quint64 PseudoClass_Focus
const quint64 PseudoClass_Enabled
const quint64 PseudoClass_Editable
const quint64 PseudoClass_Vertical
const quint64 PseudoClass_Flat
const quint64 PseudoClass_NonExclusive
const quint64 PseudoClass_Pressed
const quint64 PseudoClass_Item
const quint64 PseudoClass_Alternate
const quint64 PseudoClass_PreviousSelected
const quint64 PseudoClass_Closable
const quint64 PseudoClass_Horizontal
const quint64 PseudoClass_Active
const quint64 PseudoClass_NextSelected
@ StyleFeature_BackgroundGradient
@ StyleFeature_BackgroundColor
const quint64 PseudoClass_Open
const quint64 PseudoClass_Frameless
const quint64 PseudoClass_Checked
const quint64 PseudoClass_Selected
const quint64 PseudoClass_Right
@ OutlineBottomRightRadius
@ BorderBottomRightRadius
@ OutlineBottomLeftRadius
@ QtForegroundTextureCacheKey
const quint64 PseudoClass_Window
const quint64 PseudoClass_Minimized
const quint64 PseudoClass_Unspecified
const quint64 PseudoClass_Unchecked
const quint64 PseudoClass_First
const quint64 PseudoClass_Indeterminate
const quint64 PseudoClass_Middle
const quint64 PseudoClass_Top
const quint64 PseudoClass_Hover
const quint64 PseudoClass_Left
const quint64 PseudoClass_Last
const quint64 PseudoClass_OnlyOne
const quint64 PseudoClass_Exclusive
Combined button and popup list for selecting options.
QPair< qreal, QColor > QGradientStop
static void setTextDecorationFromValues(const QList< QCss::Value > &values, QFont *font)
static void removeOptionalQuotes(QString *str)
static bool setFontFamilyFromValues(const QList< QCss::Value > &values, QFont *font, int start=0)
static bool setFontWeightFromValue(const QCss::Value &value, QFont *font)
static const QCssKnownValue origins[NumKnownOrigins - 1]
static int lengthValueFromData(const LengthData &data, const QFont &f)
static void setTextTransformFromValue(const QCss::Value &value, QFont *font)
static bool setFontSizeFromValue(QCss::Value value, QFont *font, int *fontSizeAdjustment)
static const QCssKnownValue pseudos[NumPseudos - 1]
static bool setFontStyleFromValue(const QCss::Value &value, QFont *font)
static ColorData parseColorValue(QCss::Value v)
static BorderStyle parseStyleValue(const QCss::Value &v)
static const QCssKnownValue styleFeatures[NumKnownStyleFeatures - 1]
static void setFontVariantFromValue(const QCss::Value &value, QFont *font)
static bool intValueHelper(const QCss::Value &v, int *i, const char *unit)
static quint64 findKnownValue(const QString &name, const QCssKnownValue *start, int numValues)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
static Qt::Alignment parseAlignment(const QCss::Value *values, int count)
static void setLetterSpacingFromValue(const QCss::Value &value, QFont *font)
static BrushData parseBrushValue(const QCss::Value &v, const QPalette &pal)
static const QCssKnownValue properties[NumProperties - 1]
static bool isHexDigit(const char c)
static bool isInheritable(Property propertyId)
static bool setFontKerningFromValue(const QCss::Value &value, QFont *font)
static void parseShorthandBackgroundProperty(const QList< QCss::Value > &values, BrushData *brush, QString *image, Repeat *repeat, Qt::Alignment *alignment, const QPalette &pal)
static void parseShorthandFontProperty(const QList< QCss::Value > &values, QFont *font, int *fontSizeAdjustment)
static const QCssKnownValue tileModes[NumKnownTileModes - 1]
static QBrush brushFromData(const BrushData &c, const QPalette &pal)
static const short indexOfId[NumKnownValues]
static void setWordSpacingFromValue(const QCss::Value &value, QFont *font)
static const QCssKnownValue repeats[NumKnownRepeats - 1]
static QColor colorFromData(const ColorData &c, const QPalette &pal)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
int qRound(qfloat16 d) noexcept
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
GLint GLfloat GLfloat GLfloat v2
GLenum GLsizei GLsizei GLint * values
[15]
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint * ids
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLuint GLuint GLfloat weight
GLsizei const GLenum * attachments
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLfloat GLfloat GLfloat GLfloat v3
GLfloat GLfloat GLfloat GLfloat h
GLuint GLsizei const GLuint const GLintptr * offsets
GLuint64EXT GLuint GLuint GLenum GLenum GLuint GLenum GLuint GLenum target2
GLfloat GLfloat GLfloat alpha
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLenum GLenum input
static bool hasAlpha(const QImage &image)
static QT_BEGIN_NAMESPACE bool isRelative(const QString &path)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
#define qPrintable(string)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
static int compare(quint64 a, quint64 b)
unsigned long long quint64
static int toInt(const QChar &qc, int R)
QT_BEGIN_NAMESPACE typedef uchar * output
QFileSelector selector
[1]
QUrl url("example.com")
[constructor-url-reference]
ValueMatchType valueMatchCriterium
@ MatchNextSelectorIfDirectAdjecent
@ MatchNextSelectorIfIndirectAdjecent
@ MatchNextSelectorIfParent
@ MatchNextSelectorIfAncestor
QList< AttributeSelector > attributeSelectors
enum QCss::BrushData::@403 type
enum QCss::ColorData::@401 type
void colorValues(QColor *c, const QPalette &=QPalette()) const
int styleFeaturesValue() const
Attachment attachmentValue() const
Origin originValue() const
void styleValues(BorderStyle *s) const
Qt::Alignment alignmentValue() const
bool realValue(qreal *r, const char *unit=nullptr) const
QExplicitlySharedDataPointer< DeclarationData > d
QColor colorValue(const QPalette &=QPalette()) const
void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const
void brushValues(QBrush *c, const QPalette &=QPalette()) const
bool intValue(int *i, const char *unit=nullptr) const
BorderStyle styleValue() const
Repeat repeatValue() const
PositionMode positionValue() const
bool borderCollapseValue() const
QBrush brushValue(const QPalette &=QPalette()) const
QList< BasicSelector > basicSelectors
QString pseudoElement() const
quint64 pseudoClass(quint64 *negated=nullptr) const
QList< Selector > selectors
QList< Declaration > declarations
QList< StyleRule > styleRules
QList< MediaRule > mediaRules
Q_GUI_EXPORT void buildIndexes(Qt::CaseSensitivity nameCaseSensitivity=Qt::CaseSensitive)
QMultiHash< QString, StyleRule > idIndex
QMultiHash< QString, StyleRule > nameIndex
QList< ImportRule > importRules
QList< PageRule > pageRules
Q_GUI_EXPORT QString lexem() const
Q_GUI_EXPORT QString toString() const