diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-22 11:44:14 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2020-06-29 19:19:47 +0200 |
commit | 9fa3cf15c8500fba5bbb861f1925160815ae2afd (patch) | |
tree | f779e08446bf302803b27130cf4c92fe46ba68b6 /src/gui/text/qcssparser_p.h | |
parent | c70c4e42665eb34e677fc51a49552c9af3f58d7a (diff) |
Use QList instead of QVector in gui
Applied to headers only. Source file to be changed separately.
Task-number: QTBUG-84469
Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/text/qcssparser_p.h')
-rw-r--r-- | src/gui/text/qcssparser_p.h | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index ef5ae8c80b..f340a23cde 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -53,7 +53,7 @@ #include <QtGui/private/qtguiglobal_p.h> #include <QtCore/QStringList> -#include <QtCore/QVector> +#include <QtCore/QList> #include <QtCore/QVariant> #include <QtCore/QPair> #include <QtCore/QSize> @@ -432,11 +432,10 @@ struct BorderData { }; QT_CSS_DECLARE_TYPEINFO(BorderData, Q_MOVABLE_TYPE) - // 1. StyleRule - x:hover, y:clicked > z:checked { prop1: value1; prop2: value2; } -// 2. QVector<Selector> - x:hover, y:clicked z:checked -// 3. QVector<BasicSelector> - y:clicked z:checked -// 4. QVector<Declaration> - { prop1: value1; prop2: value2; } +// 2. QList<Selector> - x:hover, y:clicked z:checked +// 3. QList<BasicSelector> - y:clicked z:checked +// 4. QList<Declaration> - { prop1: value1; prop2: value2; } // 5. Declaration - prop1: value1; struct Q_GUI_EXPORT Declaration @@ -446,7 +445,7 @@ struct Q_GUI_EXPORT Declaration inline DeclarationData() : propertyId(UnknownProperty), important(false), inheritable(false) {} QString property; Property propertyId; - QVector<Value> values; + QList<Value> values; QVariant parsed; bool important:1; bool inheritable:1; @@ -578,8 +577,8 @@ struct BasicSelector QString elementName; QStringList ids; - QVector<Pseudo> pseudos; - QVector<AttributeSelector> attributeSelectors; + QList<Pseudo> pseudos; + QList<AttributeSelector> attributeSelectors; Relation relationToNext; }; @@ -587,7 +586,7 @@ QT_CSS_DECLARE_TYPEINFO(BasicSelector, Q_MOVABLE_TYPE) struct Q_GUI_EXPORT Selector { - QVector<BasicSelector> basicSelectors; + QList<BasicSelector> basicSelectors; int specificity() const; quint64 pseudoClass(quint64 *negated = nullptr) const; QString pseudoElement() const; @@ -597,8 +596,8 @@ QT_CSS_DECLARE_TYPEINFO(Selector, Q_MOVABLE_TYPE) struct StyleRule { StyleRule() : order(0) { } - QVector<Selector> selectors; - QVector<Declaration> declarations; + QList<Selector> selectors; + QList<Declaration> declarations; int order; }; QT_CSS_DECLARE_TYPEINFO(StyleRule, Q_MOVABLE_TYPE) @@ -606,14 +605,14 @@ QT_CSS_DECLARE_TYPEINFO(StyleRule, Q_MOVABLE_TYPE) struct MediaRule { QStringList media; - QVector<StyleRule> styleRules; + QList<StyleRule> styleRules; }; QT_CSS_DECLARE_TYPEINFO(MediaRule, Q_MOVABLE_TYPE) struct PageRule { QString selector; - QVector<Declaration> declarations; + QList<Declaration> declarations; }; QT_CSS_DECLARE_TYPEINFO(PageRule, Q_MOVABLE_TYPE) @@ -635,10 +634,10 @@ enum StyleSheetOrigin { struct StyleSheet { StyleSheet() : origin(StyleSheetOrigin_Unspecified), depth(0) { } - QVector<StyleRule> styleRules; //only contains rules that are not indexed - QVector<MediaRule> mediaRules; - QVector<PageRule> pageRules; - QVector<ImportRule> importRules; + QList<StyleRule> styleRules; // only contains rules that are not indexed + QList<MediaRule> mediaRules; + QList<PageRule> pageRules; + QList<ImportRule> importRules; StyleSheetOrigin origin; int depth; // applicable only for inline style sheets QMultiHash<QString, StyleRule> nameIndex; @@ -660,8 +659,8 @@ public: int id; }; - QVector<StyleRule> styleRulesForNode(NodePtr node); - QVector<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = nullptr); + QList<StyleRule> styleRulesForNode(NodePtr node); + QList<Declaration> declarationsForNode(NodePtr node, const char *extraPseudo = nullptr); virtual bool nodeNameEquals(NodePtr node, const QString& nodeName) const; virtual QString attribute(NodePtr node, const QString &name) const = 0; @@ -674,7 +673,7 @@ public: virtual NodePtr duplicateNode(NodePtr node) const = 0; virtual void freeNode(NodePtr node) const = 0; - QVector<StyleSheet> styleSheets; + QList<StyleSheet> styleSheets; QString medium; Qt::CaseSensitivity nameCaseSensitivity; private: @@ -750,7 +749,7 @@ class Q_GUI_EXPORT Scanner { public: static QString preprocess(const QString &input, bool *hasEscapeSequences = nullptr); - static void scan(const QString &preprocessedInput, QVector<Symbol> *symbols); + static void scan(const QString &preprocessedInput, QList<Symbol> *symbols); }; class Q_GUI_EXPORT Parser @@ -780,7 +779,7 @@ public: bool parsePseudo(Pseudo *pseudo); bool parseNextDeclaration(Declaration *declaration); bool parsePrio(Declaration *declaration); - bool parseExpr(QVector<Value> *values); + bool parseExpr(QList<Value> *values); bool parseTerm(Value *value); bool parseFunction(QString *name, QString *args); bool parseHexColor(QColor *col); @@ -805,7 +804,12 @@ public: inline bool testProperty() { return test(IDENT); } bool testTerm(); inline bool testExpr() { return testTerm(); } - inline bool parseNextExpr(QVector<Value> *values) { if (!testExpr()) return recordError(); return parseExpr(values); } + inline bool parseNextExpr(QList<Value> *values) + { + if (!testExpr()) + return recordError(); + return parseExpr(values); + } bool testPrio(); inline bool testHexColor() { return test(HASH); } inline bool testFunction() { return test(FUNCTION); } @@ -833,7 +837,7 @@ public: inline bool recordError() { errorIndex = index; return false; } - QVector<Symbol> symbols; + QList<Symbol> symbols; int index; int errorIndex; bool hasEscapeSequences; @@ -842,7 +846,7 @@ public: struct Q_GUI_EXPORT ValueExtractor { - ValueExtractor(const QVector<Declaration> &declarations, const QPalette & = QPalette()); + ValueExtractor(const QList<Declaration> &declarations, const QPalette & = QPalette()); bool extractFont(QFont *font, int *fontSizeAdjustment); bool extractBackground(QBrush *, QString *, Repeat *, Qt::Alignment *, QCss::Origin *, QCss::Attachment *, @@ -868,7 +872,7 @@ private: QSize sizeValue(const Declaration &decl); void sizeValues(const Declaration &decl, QSize *radii); - QVector<Declaration> declarations; + QList<Declaration> declarations; QFont f; int adjustment; int fontExtracted; |