Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlpreviewdiff_p.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQMLPREVIEWDIFF_P_H
6#define QQMLPREVIEWDIFF_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qv4compileddata_p.h>
20
21#include <QtCore/qbytearray.h>
22#include <QtCore/qlist.h>
23#include <QtCore/qvariant.h>
24
25QT_BEGIN_NAMESPACE
26
27namespace QV4::CompiledData {
28enum class ChangeType : quint8 {
30
31 // -- Changes to various internal tables, source file, timestamp, etc.
33
37
41
45
49
53
57
63
67
71
75
76 // -- Actual document-level changes --
77
83
89
95
101
106
112
117
123
129
131};
132
146
152
158
169
175
177{
179 QList<quint32_le> strings; // 2*size entries: raw[0..size-1] then cooked[0..size-1]
180};
181
187
193
207
208struct NoHunk {};
209
210struct Change
211{
213 int objectIndex = -1;
214
215 // Position in the *new* unit (binding/property/function/object/etc newIndex depending on type).
216 // For a Removed change there is no new position; newIndex then holds the old position instead.
218
219 // Position in the *old* unit. For positionally-matched tables this equals newIndex.
220 // For an Added change there is no old position; oldIndex then holds the new position instead.
222
228};
229
231{
233 bool success = false;
234};
235
236// Compare two compilation units and return a diff describing the changes
237CompilationUnitDiff diffCompilationUnits(const Unit *oldUnit, const Unit *newUnit);
238
239} // namespace QV4::CompiledData
240
241QT_END_NAMESPACE
242
243#endif // QQMLPREVIEWDIFF_P_H
static Severity classifyChange(const Change &change)
CompilationUnitDiff diffCompilationUnits(const Unit *oldUnit, const Unit *newUnit)
IndexedElements(AccessorFn, quint32) -> IndexedElements< AccessorFn >
static EnumHunk extractData(const Enum &e)
Data extractData(const Data &data)
static void sortChanges(QSpan< Change > changes)
Definition qjsvalue.h:24
#define COMPARISON_TRAITS(Element)
#define COMPARISON_TRAITS_WITH_LOCATION_AND_INDEX(Element)
#define COMPARISON_TRAITS_WITH_LOCATION(Element)
std::variant< NoHunk, ConstantHunk, BindingHunk, PropertyHunk, AliasHunk, EnumHunk, SignalHunk, ObjectHunk, UnitHunk, StringHunk, LookupHunk, RegExpHunk, FunctionHunk, ClassHunk, TemplateObjectHunk, JsClassHunk, BlockHunk, ImportHunk, TranslationDataHunk, InlineComponentHunk, RequiredPropertyExtraDataHunk > data
QList< CodeOffsetToLineAndStatement > lineAndStatementNumbers
QList< RequiredPropertyExtraDataHunk > requiredPropertyExtraData
QList< FunctionIndexHunk > functionIndices
QList< PropertyHunk > properties
QList< InlineComponentHunk > inlineComponents
bool objectContentEqual(const Object &oldObj, const Object &newObj) const
void compareObjectProperties(const Object *oldObj, const Object *newObj)
bool parameterTypeContentEqual(const ParameterType &oldType, const ParameterType &newType) const
void compareNamedElements(OldSource oldSource, NewSource newSource, KeyFn keyFn, ContentEqFn contentEq)
bool aliasContentEqual(const Alias &oldAlias, const Alias &newAlias) const
QHash< const Function *, QString > functionOwnerKeys(const Unit *unit) const
void compareObjectInlineComponents(const Object *oldObj, const Object *newObj)
bool enumContentEqual(const Enum &oldEnum, const Enum &newEnum) const
bool stringsEqual(uint oldName, uint newName) const
void compareObjectBindings(const Object *oldObj, const Object *newObj)
bool blockContentEqual(const Block &oldBlock, const Block &newBlock) const
void compareObjectRequiredPropertyExtraData(const Object *oldObj, const Object *newObj)
bool jsClassContentEqual(const JSClass &oldJC, const JSClass &newJC) const
void compareObjectAliases(const Object *oldObj, const Object *newObj)
bool translationContentEqual(const TranslationData &oldTrans, const TranslationData &newTrans) const
bool signalContentEqual(const Signal &oldSig, const Signal &newSig) const
void compareObjectEnums(const Object *oldObj, const Object *newObj)
bool templateObjectContentEqual(const TemplateObject &oldTO, const TemplateObject &newTO) const
bool propertyContentEqual(const Property &oldProp, const Property &newProp) const
bool functionContentEqual(const Function &oldFunc, const Function &newFunc) const
bool classContentEqual(const Class &oldCls, const Class &newCls) const
void compareObjectSignals(const Object *oldObj, const Object *newObj)
void compareIndexedElements(OldSource oldSource, NewSource newSource, ContentEqFn contentEq)
bool bindingContentEqual(const Binding &oldBinding, const Binding &newBinding) const