diff options
265 files changed, 2405 insertions, 190 deletions
diff --git a/examples/quick/CMakeLists.txt b/examples/quick/CMakeLists.txt index 8ab3ef3360..1e7adc5d66 100644 --- a/examples/quick/CMakeLists.txt +++ b/examples/quick/CMakeLists.txt @@ -40,7 +40,9 @@ if(TARGET Qt6::QuickWidgets AND TARGET Qt6::Widgets AND (QT_FEATURE_opengl OR QT endif() add_subdirectory(quickshapes) qt_internal_add_example(advancedtext) -qt_internal_add_example(vectorimage) +if(TARGET Qt6::Svg) + qt_internal_add_example(vectorimage) +endif() # qt_examples_build_end() misses at least some of these due to some # source subdirectories being added multiple times. See QTBUG-96159. diff --git a/examples/quick/quickshapes/CMakeLists.txt b/examples/quick/quickshapes/CMakeLists.txt index e739c3dc89..c65bee6799 100644 --- a/examples/quick/quickshapes/CMakeLists.txt +++ b/examples/quick/quickshapes/CMakeLists.txt @@ -1,12 +1,16 @@ # Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -qt_internal_add_example(shapes) -qt_internal_add_example(weatherforecast) - # qt_examples_build_end() misses at least some of these due to some # source subdirectories being added multiple times. See QTBUG-96159. -set(reused_dir_targets shapes_shared weatherforecast_shared) +set(reused_dir_targets shapes_shared) + +qt_internal_add_example(shapes) + +if(TARGET Qt6::Svg) + list(APPEND reused_dir_targets weatherforecast_shared) + qt_internal_add_example(weatherforecast) +endif() foreach(target IN LISTS reused_dir_targets) if(TARGET ${target}) diff --git a/src/labs/animation/qquickboundaryrule.cpp b/src/labs/animation/qquickboundaryrule.cpp index 1fc996925f..a6c7626db6 100644 --- a/src/labs/animation/qquickboundaryrule.cpp +++ b/src/labs/animation/qquickboundaryrule.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:default #include "qquickboundaryrule_p.h" diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index a50685ba50..82d807af7e 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -57,6 +57,8 @@ QQmlAnimationTimer::~QQmlAnimationTimer() unsetJobTimer(animation); for (const auto &animation : std::as_const(runningPauseAnimations)) unsetJobTimer(animation); + + QUnifiedTimer::stopAnimationTimer(this); } QQmlAnimationTimer *QQmlAnimationTimer::instance(bool create) diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp index 74b79cb400..6a6fd7e607 100644 --- a/src/qml/jsruntime/qv4argumentsobject.cpp +++ b/src/qml/jsruntime/qv4argumentsobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4argumentsobject_p.h" diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h index 0487bd22f8..8be96a690f 100644 --- a/src/qml/jsruntime/qv4argumentsobject_p.h +++ b/src/qml/jsruntime/qv4argumentsobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ARGUMENTSOBJECTS_H #define QV4ARGUMENTSOBJECTS_H diff --git a/src/qml/jsruntime/qv4arraybuffer.cpp b/src/qml/jsruntime/qv4arraybuffer.cpp index c4ef28ae49..f61513566b 100644 --- a/src/qml/jsruntime/qv4arraybuffer.cpp +++ b/src/qml/jsruntime/qv4arraybuffer.cpp @@ -1,5 +1,10 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser + +// Security note: ArrayBuffer can be used with arbitrary binary data stored in QBA +// and requires some care (we e.g. don't want to create a corrupted QBA in asByteArray) + #include "qv4arraybuffer_p.h" #include "qv4typedarray_p.h" #include "qv4dataview_p.h" diff --git a/src/qml/jsruntime/qv4arraybuffer_p.h b/src/qml/jsruntime/qv4arraybuffer_p.h index af1195a947..c38deb8de8 100644 --- a/src/qml/jsruntime/qv4arraybuffer_p.h +++ b/src/qml/jsruntime/qv4arraybuffer_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ARRAYBUFFER_H #define QV4ARRAYBUFFER_H diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index f691fe6beb..ed8d233578 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4arraydata_p.h" #include "qv4object_p.h" #include "qv4functionobject_p.h" diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h index 32ff27b388..337812ce3b 100644 --- a/src/qml/jsruntime/qv4arraydata_p.h +++ b/src/qml/jsruntime/qv4arraydata_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ARRAYDATA_H #define QV4ARRAYDATA_H diff --git a/src/qml/jsruntime/qv4arrayiterator.cpp b/src/qml/jsruntime/qv4arrayiterator.cpp index 15e0bf4e4c..d8cdc173b7 100644 --- a/src/qml/jsruntime/qv4arrayiterator.cpp +++ b/src/qml/jsruntime/qv4arrayiterator.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2017 Crimson AS <info@crimson.no> // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qv4iterator_p.h> #include <private/qv4arrayiterator_p.h> diff --git a/src/qml/jsruntime/qv4arrayiterator_p.h b/src/qml/jsruntime/qv4arrayiterator_p.h index 79f0898fb6..ab2f7989f9 100644 --- a/src/qml/jsruntime/qv4arrayiterator_p.h +++ b/src/qml/jsruntime/qv4arrayiterator_p.h @@ -1,6 +1,7 @@ // Copyright (C) 2017 Crimson AS <info@crimson.no> // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ARRAYITERATOR_P_H #define QV4ARRAYITERATOR_P_H diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 121a15da9a..d41f446594 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4arrayobject_p.h" #include "qv4arrayiterator_p.h" diff --git a/src/qml/jsruntime/qv4arrayobject_p.h b/src/qml/jsruntime/qv4arrayobject_p.h index 6cca9055a2..7550b1f8a0 100644 --- a/src/qml/jsruntime/qv4arrayobject_p.h +++ b/src/qml/jsruntime/qv4arrayobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ARRAYOBJECT_H #define QV4ARRAYOBJECT_H diff --git a/src/qml/jsruntime/qv4atomics.cpp b/src/qml/jsruntime/qv4atomics.cpp index ccbdef145b..899111be27 100644 --- a/src/qml/jsruntime/qv4atomics.cpp +++ b/src/qml/jsruntime/qv4atomics.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4arraybuffer_p.h" #include "qv4typedarray_p.h" #include "qv4atomics_p.h" diff --git a/src/qml/jsruntime/qv4atomics_p.h b/src/qml/jsruntime/qv4atomics_p.h index d55e6bb983..b58522c32b 100644 --- a/src/qml/jsruntime/qv4atomics_p.h +++ b/src/qml/jsruntime/qv4atomics_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ATOMICS_H #define QV4ATOMICS_H diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp index 5c1d50e753..45692e8030 100644 --- a/src/qml/jsruntime/qv4booleanobject.cpp +++ b/src/qml/jsruntime/qv4booleanobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4booleanobject_p.h" diff --git a/src/qml/jsruntime/qv4booleanobject_p.h b/src/qml/jsruntime/qv4booleanobject_p.h index 1b2d3914ac..fcaa4d64e4 100644 --- a/src/qml/jsruntime/qv4booleanobject_p.h +++ b/src/qml/jsruntime/qv4booleanobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4BOOLEANOBJECT_H #define QV4BOOLEANOBJECT_H diff --git a/src/qml/jsruntime/qv4compilationunitmapper.cpp b/src/qml/jsruntime/qv4compilationunitmapper.cpp index e9915c7d26..d4c35fd844 100644 --- a/src/qml/jsruntime/qv4compilationunitmapper.cpp +++ b/src/qml/jsruntime/qv4compilationunitmapper.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4compilationunitmapper_p.h" diff --git a/src/qml/jsruntime/qv4compilationunitmapper_p.h b/src/qml/jsruntime/qv4compilationunitmapper_p.h index c214141804..26558b28f0 100644 --- a/src/qml/jsruntime/qv4compilationunitmapper_p.h +++ b/src/qml/jsruntime/qv4compilationunitmapper_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4COMPILATIONUNITMAPPER_H #define QV4COMPILATIONUNITMAPPER_H diff --git a/src/qml/jsruntime/qv4compilationunitmapper_unix.cpp b/src/qml/jsruntime/qv4compilationunitmapper_unix.cpp index 204e222121..9675acf8fd 100644 --- a/src/qml/jsruntime/qv4compilationunitmapper_unix.cpp +++ b/src/qml/jsruntime/qv4compilationunitmapper_unix.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4compilationunitmapper_p.h" diff --git a/src/qml/jsruntime/qv4compilationunitmapper_win.cpp b/src/qml/jsruntime/qv4compilationunitmapper_win.cpp index 73096207b4..3b38fc04d6 100644 --- a/src/qml/jsruntime/qv4compilationunitmapper_win.cpp +++ b/src/qml/jsruntime/qv4compilationunitmapper_win.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4compilationunitmapper_p.h" diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 01f9b4adf3..3e59a2d7df 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <QString> #include <qv4context_p.h> diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index 48b6e04025..45ee61de4e 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QMLJS_ENVIRONMENT_H #define QMLJS_ENVIRONMENT_H diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp index 689eb9232b..440d50e04e 100644 --- a/src/qml/jsruntime/qv4dataview.cpp +++ b/src/qml/jsruntime/qv4dataview.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4dataview_p.h" #include "qv4arraybuffer_p.h" diff --git a/src/qml/jsruntime/qv4dataview_p.h b/src/qml/jsruntime/qv4dataview_p.h index b5fa41d964..091f7e7ba9 100644 --- a/src/qml/jsruntime/qv4dataview_p.h +++ b/src/qml/jsruntime/qv4dataview_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4DATAVIEW_H #define QV4DATAVIEW_H diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index 4593c788d3..316f8707ee 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4dateobject_p.h" #include "qv4runtime_p.h" diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h index 248c549744..6e6546bacc 100644 --- a/src/qml/jsruntime/qv4dateobject_p.h +++ b/src/qml/jsruntime/qv4dateobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4DATEOBJECT_P_H #define QV4DATEOBJECT_P_H diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index 57ddaaa2f1..b7b7a5fd4a 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4debugging_p.h" diff --git a/src/qml/jsruntime/qv4debugging_p.h b/src/qml/jsruntime/qv4debugging_p.h index b80567b339..25a510e720 100644 --- a/src/qml/jsruntime/qv4debugging_p.h +++ b/src/qml/jsruntime/qv4debugging_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4DEBUGGING_H #define QV4DEBUGGING_H diff --git a/src/qml/jsruntime/qv4domerrors.cpp b/src/qml/jsruntime/qv4domerrors.cpp index cd26858aa3..6ecba4a33e 100644 --- a/src/qml/jsruntime/qv4domerrors.cpp +++ b/src/qml/jsruntime/qv4domerrors.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4domerrors_p.h" #include "qv4object_p.h" diff --git a/src/qml/jsruntime/qv4domerrors_p.h b/src/qml/jsruntime/qv4domerrors_p.h index 491fff9e55..5ea6a898da 100644 --- a/src/qml/jsruntime/qv4domerrors_p.h +++ b/src/qml/jsruntime/qv4domerrors_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4DOMERRORS_P_H #define QV4DOMERRORS_P_H diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index f7ab2bd72e..fa03df55d4 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4engine_p.h" diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 6cb4609450..41c7e776ff 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ENGINE_H #define QV4ENGINE_H diff --git a/src/qml/jsruntime/qv4enginebase_p.h b/src/qml/jsruntime/qv4enginebase_p.h index 68e906baa1..67c5953045 100644 --- a/src/qml/jsruntime/qv4enginebase_p.h +++ b/src/qml/jsruntime/qv4enginebase_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ENGINEBASE_P_H #define QV4ENGINEBASE_P_H diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp index 02145a0243..adf2f30108 100644 --- a/src/qml/jsruntime/qv4errorobject.cpp +++ b/src/qml/jsruntime/qv4errorobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4errorobject_p.h" diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h index f9adbb443b..508d7657ae 100644 --- a/src/qml/jsruntime/qv4errorobject_p.h +++ b/src/qml/jsruntime/qv4errorobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ERROROBJECT_H #define QV4ERROROBJECT_H diff --git a/src/qml/jsruntime/qv4estable.cpp b/src/qml/jsruntime/qv4estable.cpp index 40c62f11e4..8ec17d6066 100644 --- a/src/qml/jsruntime/qv4estable.cpp +++ b/src/qml/jsruntime/qv4estable.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4estable_p.h" #include "qv4object_p.h" diff --git a/src/qml/jsruntime/qv4estable_p.h b/src/qml/jsruntime/qv4estable_p.h index 037a3689aa..32f6c1651f 100644 --- a/src/qml/jsruntime/qv4estable_p.h +++ b/src/qml/jsruntime/qv4estable_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant // // W A R N I N G diff --git a/src/qml/jsruntime/qv4executableallocator.cpp b/src/qml/jsruntime/qv4executableallocator.cpp index 71d8061d65..a534827b65 100644 --- a/src/qml/jsruntime/qv4executableallocator.cpp +++ b/src/qml/jsruntime/qv4executableallocator.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4executableallocator_p.h" #include <QtQml/private/qv4functiontable_p.h> diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h index 8181bf17ae..3c0fa0e790 100644 --- a/src/qml/jsruntime/qv4executableallocator_p.h +++ b/src/qml/jsruntime/qv4executableallocator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4EXECUTABLEALLOCATOR_H #define QV4EXECUTABLEALLOCATOR_H diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index cd55c20bd0..3ec029cf4b 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qml/qqmlprivate.h" #include "qv4engine_p.h" diff --git a/src/qml/jsruntime/qv4executablecompilationunit_p.h b/src/qml/jsruntime/qv4executablecompilationunit_p.h index 9b467564d3..8cead907e7 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit_p.h +++ b/src/qml/jsruntime/qv4executablecompilationunit_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4EXECUTABLECOMPILATIONUNIT_P_H #define QV4EXECUTABLECOMPILATIONUNIT_P_H diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index 20dbff4cea..267e97ad95 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4function_p.h" diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 8161c17406..a73be5c2af 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4FUNCTION_H #define QV4FUNCTION_H diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index f258ecce58..3bf36a7acc 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4object_p.h" #include "qv4function_p.h" diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index f4a2935b5a..e5e4c74ca1 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4FUNCTIONOBJECT_H #define QV4FUNCTIONOBJECT_H diff --git a/src/qml/jsruntime/qv4functiontable_noop.cpp b/src/qml/jsruntime/qv4functiontable_noop.cpp index 8a72fa5469..0fc98894ff 100644 --- a/src/qml/jsruntime/qv4functiontable_noop.cpp +++ b/src/qml/jsruntime/qv4functiontable_noop.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4functiontable_p.h" diff --git a/src/qml/jsruntime/qv4functiontable_p.h b/src/qml/jsruntime/qv4functiontable_p.h index 8937e2fe85..80b1b80b93 100644 --- a/src/qml/jsruntime/qv4functiontable_p.h +++ b/src/qml/jsruntime/qv4functiontable_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4FUNCTIONTABLE_P_H #define QV4FUNCTIONTABLE_P_H diff --git a/src/qml/jsruntime/qv4functiontable_unix.cpp b/src/qml/jsruntime/qv4functiontable_unix.cpp index 9561917777..337700d55e 100644 --- a/src/qml/jsruntime/qv4functiontable_unix.cpp +++ b/src/qml/jsruntime/qv4functiontable_unix.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4functiontable_p.h" #include "qv4function_p.h" diff --git a/src/qml/jsruntime/qv4functiontable_win64.cpp b/src/qml/jsruntime/qv4functiontable_win64.cpp index c21cdb790a..d2772fd9ec 100644 --- a/src/qml/jsruntime/qv4functiontable_win64.cpp +++ b/src/qml/jsruntime/qv4functiontable_win64.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4functiontable_p.h" diff --git a/src/qml/jsruntime/qv4generatorobject.cpp b/src/qml/jsruntime/qv4generatorobject.cpp index efe4cde76b..b294681ad2 100644 --- a/src/qml/jsruntime/qv4generatorobject.cpp +++ b/src/qml/jsruntime/qv4generatorobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <qv4generatorobject_p.h> #include <qv4symbol_p.h> diff --git a/src/qml/jsruntime/qv4generatorobject_p.h b/src/qml/jsruntime/qv4generatorobject_p.h index a70548128b..a7525853bc 100644 --- a/src/qml/jsruntime/qv4generatorobject_p.h +++ b/src/qml/jsruntime/qv4generatorobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4GENERATOROBJECT_P_H #define QV4GENERATOROBJECT_P_H diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index e3fc0ac1b3..b4a23af3b6 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4GLOBAL_H #define QV4GLOBAL_H diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index dffa76aabb..2834b38e37 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4globalobject_p.h" diff --git a/src/qml/jsruntime/qv4globalobject_p.h b/src/qml/jsruntime/qv4globalobject_p.h index fd23d71332..45ca549b2b 100644 --- a/src/qml/jsruntime/qv4globalobject_p.h +++ b/src/qml/jsruntime/qv4globalobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4GLOBALOBJECT_H #define QV4GLOBALOBJECT_H diff --git a/src/qml/jsruntime/qv4identifierhash.cpp b/src/qml/jsruntime/qv4identifierhash.cpp index 48df2283f0..a89379eb66 100644 --- a/src/qml/jsruntime/qv4identifierhash.cpp +++ b/src/qml/jsruntime/qv4identifierhash.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qv4identifierhash_p.h> #include <private/qv4identifiertable_p.h> diff --git a/src/qml/jsruntime/qv4identifierhash_p.h b/src/qml/jsruntime/qv4identifierhash_p.h index 6c77a78f85..0a723766b5 100644 --- a/src/qml/jsruntime/qv4identifierhash_p.h +++ b/src/qml/jsruntime/qv4identifierhash_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4IDENTIFIERHASH_P_H #define QV4IDENTIFIERHASH_P_H diff --git a/src/qml/jsruntime/qv4identifierhashdata_p.h b/src/qml/jsruntime/qv4identifierhashdata_p.h index 664e8e803d..04f845d985 100644 --- a/src/qml/jsruntime/qv4identifierhashdata_p.h +++ b/src/qml/jsruntime/qv4identifierhashdata_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4IDENTIFIERHASHDATA_H #define QV4IDENTIFIERHASHDATA_H diff --git a/src/qml/jsruntime/qv4identifiertable.cpp b/src/qml/jsruntime/qv4identifiertable.cpp index 4c915442f4..b4ffd070ee 100644 --- a/src/qml/jsruntime/qv4identifiertable.cpp +++ b/src/qml/jsruntime/qv4identifiertable.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4identifiertable_p.h" #include "qv4symbol_p.h" #include <private/qv4identifierhashdata_p.h> diff --git a/src/qml/jsruntime/qv4identifiertable_p.h b/src/qml/jsruntime/qv4identifiertable_p.h index 2ecd4a7294..5df18396e5 100644 --- a/src/qml/jsruntime/qv4identifiertable_p.h +++ b/src/qml/jsruntime/qv4identifiertable_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4IDENTIFIERTABLE_H #define QV4IDENTIFIERTABLE_H diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp index b09c7c3bd7..b174a79bd8 100644 --- a/src/qml/jsruntime/qv4include.cpp +++ b/src/qml/jsruntime/qv4include.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4include_p.h" #include "qv4scopedvalue_p.h" diff --git a/src/qml/jsruntime/qv4include_p.h b/src/qml/jsruntime/qv4include_p.h index 5f6e3172da..066a665fee 100644 --- a/src/qml/jsruntime/qv4include_p.h +++ b/src/qml/jsruntime/qv4include_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4INCLUDE_P_H #define QV4INCLUDE_P_H diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp index 5b21d5ac07..05d4e07459 100644 --- a/src/qml/jsruntime/qv4internalclass.cpp +++ b/src/qml/jsruntime/qv4internalclass.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <qv4internalclass_p.h> #include <qv4string_p.h> diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 56ce787859..23e8a46506 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4INTERNALCLASS_H #define QV4INTERNALCLASS_H diff --git a/src/qml/jsruntime/qv4iterator.cpp b/src/qml/jsruntime/qv4iterator.cpp index 617037ecdc..3c7045ca7b 100644 --- a/src/qml/jsruntime/qv4iterator.cpp +++ b/src/qml/jsruntime/qv4iterator.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <qv4iterator_p.h> #include <qv4symbol_p.h> #include <qv4engine_p.h> diff --git a/src/qml/jsruntime/qv4iterator_p.h b/src/qml/jsruntime/qv4iterator_p.h index 46e48864ed..641e93c4f1 100644 --- a/src/qml/jsruntime/qv4iterator_p.h +++ b/src/qml/jsruntime/qv4iterator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ITERATOR_P_H #define QV4ITERATOR_P_H diff --git a/src/qml/jsruntime/qv4jscall.cpp b/src/qml/jsruntime/qv4jscall.cpp index 513ae59145..060f6bcd0f 100644 --- a/src/qml/jsruntime/qv4jscall.cpp +++ b/src/qml/jsruntime/qv4jscall.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4jscall_p.h" diff --git a/src/qml/jsruntime/qv4jscall_p.h b/src/qml/jsruntime/qv4jscall_p.h index 5df1ca77d3..1666dec8a9 100644 --- a/src/qml/jsruntime/qv4jscall_p.h +++ b/src/qml/jsruntime/qv4jscall_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4JSCALL_H #define QV4JSCALL_H diff --git a/src/qml/jsruntime/qv4jsonobject_p.h b/src/qml/jsruntime/qv4jsonobject_p.h index f6f63d7eb3..038ab67ba5 100644 --- a/src/qml/jsruntime/qv4jsonobject_p.h +++ b/src/qml/jsruntime/qv4jsonobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4JSONOBJECT_H #define QV4JSONOBJECT_H diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index beebdcad6b..e97e40be61 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4lookup_p.h" diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h index 61184df4bb..ea6839c76b 100644 --- a/src/qml/jsruntime/qv4lookup_p.h +++ b/src/qml/jsruntime/qv4lookup_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4LOOKUP_H #define QV4LOOKUP_H diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp index bdc40da779..dedbbdd220 100644 --- a/src/qml/jsruntime/qv4managed.cpp +++ b/src/qml/jsruntime/qv4managed.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4managed_p.h" #include <private/qv4mm_p.h> diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 468be23414..6eaea9a1e9 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QMLJS_MANAGED_H #define QMLJS_MANAGED_H diff --git a/src/qml/jsruntime/qv4mapiterator.cpp b/src/qml/jsruntime/qv4mapiterator.cpp index 7afe61cbfd..531db5b47c 100644 --- a/src/qml/jsruntime/qv4mapiterator.cpp +++ b/src/qml/jsruntime/qv4mapiterator.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qv4iterator_p.h> #include <private/qv4estable_p.h> diff --git a/src/qml/jsruntime/qv4mapiterator_p.h b/src/qml/jsruntime/qv4mapiterator_p.h index 97a72db85c..43a767aff6 100644 --- a/src/qml/jsruntime/qv4mapiterator_p.h +++ b/src/qml/jsruntime/qv4mapiterator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4MAPITERATOR_P_H #define QV4MAPITERATOR_P_H diff --git a/src/qml/jsruntime/qv4mapobject.cpp b/src/qml/jsruntime/qv4mapobject.cpp index aa594ad33e..d40952fa54 100644 --- a/src/qml/jsruntime/qv4mapobject.cpp +++ b/src/qml/jsruntime/qv4mapobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4mapobject_p.h" #include "qv4mapiterator_p.h" diff --git a/src/qml/jsruntime/qv4mapobject_p.h b/src/qml/jsruntime/qv4mapobject_p.h index e7ff02c13a..6745edbde6 100644 --- a/src/qml/jsruntime/qv4mapobject_p.h +++ b/src/qml/jsruntime/qv4mapobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4MAPOBJECT_P_H #define QV4MAPOBJECT_P_H diff --git a/src/qml/jsruntime/qv4math_p.h b/src/qml/jsruntime/qv4math_p.h index b12990700d..9aadf301bc 100644 --- a/src/qml/jsruntime/qv4math_p.h +++ b/src/qml/jsruntime/qv4math_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QMLJS_MATH_H #define QMLJS_MATH_H diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp index 71ff6ec0f8..15ea692133 100644 --- a/src/qml/jsruntime/qv4mathobject.cpp +++ b/src/qml/jsruntime/qv4mathobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4mathobject_p.h" #include "qv4symbol_p.h" diff --git a/src/qml/jsruntime/qv4mathobject_p.h b/src/qml/jsruntime/qv4mathobject_p.h index 5547cbab61..a0ba0b53ed 100644 --- a/src/qml/jsruntime/qv4mathobject_p.h +++ b/src/qml/jsruntime/qv4mathobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4MATHOBJECT_H #define QV4MATHOBJECT_H diff --git a/src/qml/jsruntime/qv4memberdata.cpp b/src/qml/jsruntime/qv4memberdata.cpp index 0231641609..7768045753 100644 --- a/src/qml/jsruntime/qv4memberdata.cpp +++ b/src/qml/jsruntime/qv4memberdata.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4memberdata_p.h" #include <private/qv4mm_p.h> diff --git a/src/qml/jsruntime/qv4module.cpp b/src/qml/jsruntime/qv4module.cpp index 3ff9191cb2..16d38ee0b3 100644 --- a/src/qml/jsruntime/qv4module.cpp +++ b/src/qml/jsruntime/qv4module.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4module_p.h" diff --git a/src/qml/jsruntime/qv4module_p.h b/src/qml/jsruntime/qv4module_p.h index 43cd995b06..be03fd98f7 100644 --- a/src/qml/jsruntime/qv4module_p.h +++ b/src/qml/jsruntime/qv4module_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4MODULE #define QV4MODULE diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp index 8aef0354d8..06b806485c 100644 --- a/src/qml/jsruntime/qv4numberobject.cpp +++ b/src/qml/jsruntime/qv4numberobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4numberobject_p.h" #include "qv4runtime_p.h" diff --git a/src/qml/jsruntime/qv4numberobject_p.h b/src/qml/jsruntime/qv4numberobject_p.h index 3f0d6d9425..0235c20051 100644 --- a/src/qml/jsruntime/qv4numberobject_p.h +++ b/src/qml/jsruntime/qv4numberobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4NUMBEROBJECT_H #define QV4NUMBEROBJECT_H diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index ffa17f5a4d..2ee9c80dbf 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4object_p.h" diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 77437273d4..8456a49112 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4_OBJECT_H #define QV4_OBJECT_H diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index 573f42956d..dea5f23a74 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4objectiterator_p.h" #include "qv4object_p.h" #include "qv4iterator_p.h" diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index 2b7dd8fae1..ddc782c543 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4OBJECTITERATOR_H #define QV4OBJECTITERATOR_H diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index bd985d6525..3039b5e989 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2017 Crimson AS <info@crimson.no> // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4objectproto_p.h" diff --git a/src/qml/jsruntime/qv4objectproto_p.h b/src/qml/jsruntime/qv4objectproto_p.h index d74cd64926..5342dd2f13 100644 --- a/src/qml/jsruntime/qv4objectproto_p.h +++ b/src/qml/jsruntime/qv4objectproto_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4ECMAOBJECTS_P_H #define QV4ECMAOBJECTS_P_H diff --git a/src/qml/jsruntime/qv4persistent.cpp b/src/qml/jsruntime/qv4persistent.cpp index 4f11d0a2ad..bd2c358503 100644 --- a/src/qml/jsruntime/qv4persistent.cpp +++ b/src/qml/jsruntime/qv4persistent.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4persistent_p.h" #include <private/qv4mm_p.h> diff --git a/src/qml/jsruntime/qv4persistent_p.h b/src/qml/jsruntime/qv4persistent_p.h index d0e29a166e..9c9f369139 100644 --- a/src/qml/jsruntime/qv4persistent_p.h +++ b/src/qml/jsruntime/qv4persistent_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4PERSISTENT_H #define QV4PERSISTENT_H diff --git a/src/qml/jsruntime/qv4profiling.cpp b/src/qml/jsruntime/qv4profiling.cpp index df63d4bdf7..9367445bb5 100644 --- a/src/qml/jsruntime/qv4profiling.cpp +++ b/src/qml/jsruntime/qv4profiling.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4profiling_p.h" #include <private/qv4mm_p.h> diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h index d1e8e34ba3..d28c3d5422 100644 --- a/src/qml/jsruntime/qv4profiling_p.h +++ b/src/qml/jsruntime/qv4profiling_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4PROFILING_H #define QV4PROFILING_H diff --git a/src/qml/jsruntime/qv4promiseobject.cpp b/src/qml/jsruntime/qv4promiseobject.cpp index b8ede3e578..8141aba9cb 100644 --- a/src/qml/jsruntime/qv4promiseobject.cpp +++ b/src/qml/jsruntime/qv4promiseobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <QCoreApplication> #include <private/qv4promiseobject_p.h> diff --git a/src/qml/jsruntime/qv4promiseobject_p.h b/src/qml/jsruntime/qv4promiseobject_p.h index fbde9f95e0..05afb4f249 100644 --- a/src/qml/jsruntime/qv4promiseobject_p.h +++ b/src/qml/jsruntime/qv4promiseobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4PROMISEOBJECT_H #define QV4PROMISEOBJECT_H diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h index e7ad6b58d6..563b69d748 100644 --- a/src/qml/jsruntime/qv4property_p.h +++ b/src/qml/jsruntime/qv4property_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4PROPERTYDESCRIPTOR_H #define QV4PROPERTYDESCRIPTOR_H diff --git a/src/qml/jsruntime/qv4propertykey.cpp b/src/qml/jsruntime/qv4propertykey.cpp index 65dd7e7fc1..f2eb6175fe 100644 --- a/src/qml/jsruntime/qv4propertykey.cpp +++ b/src/qml/jsruntime/qv4propertykey.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4propertykey_p.h" diff --git a/src/qml/jsruntime/qv4propertykey_p.h b/src/qml/jsruntime/qv4propertykey_p.h index f3b05ee0d8..88b91d7499 100644 --- a/src/qml/jsruntime/qv4propertykey_p.h +++ b/src/qml/jsruntime/qv4propertykey_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4PROPERTYKEY_H #define QV4PROPERTYKEY_H diff --git a/src/qml/jsruntime/qv4proxy.cpp b/src/qml/jsruntime/qv4proxy.cpp index 0bb794187a..7083c96009 100644 --- a/src/qml/jsruntime/qv4proxy.cpp +++ b/src/qml/jsruntime/qv4proxy.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4proxy_p.h" diff --git a/src/qml/jsruntime/qv4proxy_p.h b/src/qml/jsruntime/qv4proxy_p.h index b3ce9c7a96..b56faca2f0 100644 --- a/src/qml/jsruntime/qv4proxy_p.h +++ b/src/qml/jsruntime/qv4proxy_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4PROXY_P_H #define QV4PROXY_P_H diff --git a/src/qml/jsruntime/qv4qmetaobjectwrapper.cpp b/src/qml/jsruntime/qv4qmetaobjectwrapper.cpp index 6521c98dbf..8396610517 100644 --- a/src/qml/jsruntime/qv4qmetaobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qmetaobjectwrapper.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4qmetaobjectwrapper_p.h" diff --git a/src/qml/jsruntime/qv4qmetaobjectwrapper_p.h b/src/qml/jsruntime/qv4qmetaobjectwrapper_p.h index c44b18f291..4623d2840c 100644 --- a/src/qml/jsruntime/qv4qmetaobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qmetaobjectwrapper_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4QMETAOBJECTWRAPPER_P_H #define QV4QMETAOBJECTWRAPPER_P_H diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index 7b8b448e5e..2f90237cd9 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4qmlcontext_p.h" diff --git a/src/qml/jsruntime/qv4qmlcontext_p.h b/src/qml/jsruntime/qv4qmlcontext_p.h index 1b337d4c0e..8381893478 100644 --- a/src/qml/jsruntime/qv4qmlcontext_p.h +++ b/src/qml/jsruntime/qv4qmlcontext_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4QMLCONTEXT_P_H #define QV4QMLCONTEXT_P_H diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index c3ef472d76..6665264fcc 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4qobjectwrapper_p.h" diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 397fc05d4a..cf88a2e4ef 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4QOBJECTWRAPPER_P_H #define QV4QOBJECTWRAPPER_P_H diff --git a/src/qml/jsruntime/qv4referenceobject.cpp b/src/qml/jsruntime/qv4referenceobject.cpp index fcad9b92dc..200897eb68 100644 --- a/src/qml/jsruntime/qv4referenceobject.cpp +++ b/src/qml/jsruntime/qv4referenceobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qv4referenceobject_p.h> diff --git a/src/qml/jsruntime/qv4referenceobject_p.h b/src/qml/jsruntime/qv4referenceobject_p.h index fa019f5db0..c42bed63bd 100644 --- a/src/qml/jsruntime/qv4referenceobject_p.h +++ b/src/qml/jsruntime/qv4referenceobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4REFERENCEOBJECT_P_H #define QV4REFERENCEOBJECT_P_H diff --git a/src/qml/jsruntime/qv4reflect.cpp b/src/qml/jsruntime/qv4reflect.cpp index 98abcff737..c984d821c3 100644 --- a/src/qml/jsruntime/qv4reflect.cpp +++ b/src/qml/jsruntime/qv4reflect.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4reflect_p.h" #include "qv4runtimeapi_p.h" diff --git a/src/qml/jsruntime/qv4reflect_p.h b/src/qml/jsruntime/qv4reflect_p.h index 40e1874686..3504abdc2a 100644 --- a/src/qml/jsruntime/qv4reflect_p.h +++ b/src/qml/jsruntime/qv4reflect_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4REFLECT_H #define QV4REFLECT_H diff --git a/src/qml/jsruntime/qv4regexp.cpp b/src/qml/jsruntime/qv4regexp.cpp index 8dd14d3a43..9120d70649 100644 --- a/src/qml/jsruntime/qv4regexp.cpp +++ b/src/qml/jsruntime/qv4regexp.cpp @@ -1,5 +1,7 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant +// TODO: verifyj critical part should be in YARR #include "qv4regexp_p.h" #include "qv4engine_p.h" diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h index 89f9515917..754c171dee 100644 --- a/src/qml/jsruntime/qv4regexp_p.h +++ b/src/qml/jsruntime/qv4regexp_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4REGEXP_H #define QV4REGEXP_H diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp index 144716f286..43455f47cd 100644 --- a/src/qml/jsruntime/qv4regexpobject.cpp +++ b/src/qml/jsruntime/qv4regexpobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4regexpobject_p.h" #include "qv4regexp_p.h" diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h index 179a01fb45..3c99faa183 100644 --- a/src/qml/jsruntime/qv4regexpobject_p.h +++ b/src/qml/jsruntime/qv4regexpobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4REGEXPOBJECT_H #define QV4REGEXPOBJECT_H diff --git a/src/qml/jsruntime/qv4resolvedtypereference.cpp b/src/qml/jsruntime/qv4resolvedtypereference.cpp index e8622824e2..0fcbbcbfae 100644 --- a/src/qml/jsruntime/qv4resolvedtypereference.cpp +++ b/src/qml/jsruntime/qv4resolvedtypereference.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4resolvedtypereference_p.h" diff --git a/src/qml/jsruntime/qv4resolvedtypereference_p.h b/src/qml/jsruntime/qv4resolvedtypereference_p.h index e7843c297b..087c77fddf 100644 --- a/src/qml/jsruntime/qv4resolvedtypereference_p.h +++ b/src/qml/jsruntime/qv4resolvedtypereference_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4RESOLVEDTYPEREFERNCE_P_H #define QV4RESOLVEDTYPEREFERNCE_P_H diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 0034c02b09..eaba955a6b 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4runtime_p.h" diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index a012728cd9..867b1bf479 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QMLJS_RUNTIME_H #define QMLJS_RUNTIME_H diff --git a/src/qml/jsruntime/qv4runtimeapi_p.h b/src/qml/jsruntime/qv4runtimeapi_p.h index e4a8c09370..0b48b050e6 100644 --- a/src/qml/jsruntime/qv4runtimeapi_p.h +++ b/src/qml/jsruntime/qv4runtimeapi_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4RUNTIMEAPI_P_H #define QV4RUNTIMEAPI_P_H diff --git a/src/qml/jsruntime/qv4runtimecodegen.cpp b/src/qml/jsruntime/qv4runtimecodegen.cpp index 65dc4a8c17..cabdb551c5 100644 --- a/src/qml/jsruntime/qv4runtimecodegen.cpp +++ b/src/qml/jsruntime/qv4runtimecodegen.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4engine_p.h" #include "qv4runtimecodegen_p.h" diff --git a/src/qml/jsruntime/qv4runtimecodegen_p.h b/src/qml/jsruntime/qv4runtimecodegen_p.h index 414742eaea..99adde1167 100644 --- a/src/qml/jsruntime/qv4runtimecodegen_p.h +++ b/src/qml/jsruntime/qv4runtimecodegen_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2017 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4RUNTIMECODEGEN_P_H #define QV4RUNTIMECODEGEN_P_H diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index 54579ffce6..7bb37f447f 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SCOPEDVALUE_P_H #define QV4SCOPEDVALUE_P_H diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp index d045e097a2..c40c105cbb 100644 --- a/src/qml/jsruntime/qv4script.cpp +++ b/src/qml/jsruntime/qv4script.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4script_p.h" diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h index d86b2bd7a0..a6d79cadc2 100644 --- a/src/qml/jsruntime/qv4script_p.h +++ b/src/qml/jsruntime/qv4script_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SCRIPT_H #define QV4SCRIPT_H diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 2a52b56ed2..4a18f18f46 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <QtCore/qsequentialiterable.h> diff --git a/src/qml/jsruntime/qv4sequenceobject_p.h b/src/qml/jsruntime/qv4sequenceobject_p.h index c61b18bd72..103984cf2b 100644 --- a/src/qml/jsruntime/qv4sequenceobject_p.h +++ b/src/qml/jsruntime/qv4sequenceobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SEQUENCEWRAPPER_P_H #define QV4SEQUENCEWRAPPER_P_H diff --git a/src/qml/jsruntime/qv4setiterator.cpp b/src/qml/jsruntime/qv4setiterator.cpp index 95d55af153..a29141ef70 100644 --- a/src/qml/jsruntime/qv4setiterator.cpp +++ b/src/qml/jsruntime/qv4setiterator.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qv4iterator_p.h> #include <private/qv4estable_p.h> diff --git a/src/qml/jsruntime/qv4setiterator_p.h b/src/qml/jsruntime/qv4setiterator_p.h index 37f912e01a..d0957ebf45 100644 --- a/src/qml/jsruntime/qv4setiterator_p.h +++ b/src/qml/jsruntime/qv4setiterator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SETITERATOR_P_H #define QV4SETITERATOR_P_H diff --git a/src/qml/jsruntime/qv4setobject.cpp b/src/qml/jsruntime/qv4setobject.cpp index ffd685a10b..382c6f3794 100644 --- a/src/qml/jsruntime/qv4setobject.cpp +++ b/src/qml/jsruntime/qv4setobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4setobject_p.h" diff --git a/src/qml/jsruntime/qv4setobject_p.h b/src/qml/jsruntime/qv4setobject_p.h index 118cdebd5a..d3bd0ae88d 100644 --- a/src/qml/jsruntime/qv4setobject_p.h +++ b/src/qml/jsruntime/qv4setobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 Crimson AS <info@crimson.no> // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SETOBJECT_P_H #define QV4SETOBJECT_P_H diff --git a/src/qml/jsruntime/qv4sparsearray.cpp b/src/qml/jsruntime/qv4sparsearray.cpp index 656c496a2a..5f4b70a93b 100644 --- a/src/qml/jsruntime/qv4sparsearray.cpp +++ b/src/qml/jsruntime/qv4sparsearray.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4sparsearray_p.h" #include <stdlib.h> diff --git a/src/qml/jsruntime/qv4sparsearray_p.h b/src/qml/jsruntime/qv4sparsearray_p.h index 7da42a4985..c58b756122 100644 --- a/src/qml/jsruntime/qv4sparsearray_p.h +++ b/src/qml/jsruntime/qv4sparsearray_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SPARSEARRAY_H #define QV4SPARSEARRAY_H diff --git a/src/qml/jsruntime/qv4sqlerrors.cpp b/src/qml/jsruntime/qv4sqlerrors.cpp index c942871702..8b45fe2ac1 100644 --- a/src/qml/jsruntime/qv4sqlerrors.cpp +++ b/src/qml/jsruntime/qv4sqlerrors.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4sqlerrors_p.h" #include "private/qv4engine_p.h" diff --git a/src/qml/jsruntime/qv4sqlerrors_p.h b/src/qml/jsruntime/qv4sqlerrors_p.h index a96a9037b2..64db88f6ca 100644 --- a/src/qml/jsruntime/qv4sqlerrors_p.h +++ b/src/qml/jsruntime/qv4sqlerrors_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SQLERRORS_P_H #define QV4SQLERRORS_P_H diff --git a/src/qml/jsruntime/qv4stackframe.cpp b/src/qml/jsruntime/qv4stackframe.cpp index 5117e745a0..0d80e1d6ef 100644 --- a/src/qml/jsruntime/qv4stackframe.cpp +++ b/src/qml/jsruntime/qv4stackframe.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4stackframe_p.h" #include <private/qv4qobjectwrapper_p.h> diff --git a/src/qml/jsruntime/qv4stackframe_p.h b/src/qml/jsruntime/qv4stackframe_p.h index 84ebd5c4aa..874cb57ed3 100644 --- a/src/qml/jsruntime/qv4stackframe_p.h +++ b/src/qml/jsruntime/qv4stackframe_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4STACKFRAME_H #define QV4STACKFRAME_H diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index 8b5594b43b..2fb7674dea 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4string_p.h" #include "qv4value_p.h" diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index 30e1f806f9..5dadc654fc 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4STRING_H #define QV4STRING_H diff --git a/src/qml/jsruntime/qv4stringiterator.cpp b/src/qml/jsruntime/qv4stringiterator.cpp index 9cb2711efb..c00be938e4 100644 --- a/src/qml/jsruntime/qv4stringiterator.cpp +++ b/src/qml/jsruntime/qv4stringiterator.cpp @@ -1,6 +1,7 @@ // Copyright (C) 2017 Crimson AS <info@crimson.no> // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qv4iterator_p.h> #include <private/qv4stringiterator_p.h> diff --git a/src/qml/jsruntime/qv4stringiterator_p.h b/src/qml/jsruntime/qv4stringiterator_p.h index 742b8a895d..9d0e613cea 100644 --- a/src/qml/jsruntime/qv4stringiterator_p.h +++ b/src/qml/jsruntime/qv4stringiterator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4STRINGITERATOR_P_H #define QV4STRINGITERATOR_P_H diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index ac06737bf5..0677917d8d 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4stringobject_p.h" diff --git a/src/qml/jsruntime/qv4stringobject_p.h b/src/qml/jsruntime/qv4stringobject_p.h index 73c2bd7b34..6aeacfd3e0 100644 --- a/src/qml/jsruntime/qv4stringobject_p.h +++ b/src/qml/jsruntime/qv4stringobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4STRINGOBJECT_P_H #define QV4STRINGOBJECT_P_H diff --git a/src/qml/jsruntime/qv4symbol.cpp b/src/qml/jsruntime/qv4symbol.cpp index 85ef57f680..64a40e6c21 100644 --- a/src/qml/jsruntime/qv4symbol.cpp +++ b/src/qml/jsruntime/qv4symbol.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <qv4symbol_p.h> #include <qv4functionobject_p.h> diff --git a/src/qml/jsruntime/qv4symbol_p.h b/src/qml/jsruntime/qv4symbol_p.h index 29a0189b69..54ebc1c69b 100644 --- a/src/qml/jsruntime/qv4symbol_p.h +++ b/src/qml/jsruntime/qv4symbol_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4_SYMBOL_H #define QV4_SYMBOL_H diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp index 1b7fca98a4..7a0e0b5e64 100644 --- a/src/qml/jsruntime/qv4typedarray.cpp +++ b/src/qml/jsruntime/qv4typedarray.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4typedarray_p.h" #include "qv4arrayiterator_p.h" diff --git a/src/qml/jsruntime/qv4typedarray_p.h b/src/qml/jsruntime/qv4typedarray_p.h index 50db9610c7..8ebec12399 100644 --- a/src/qml/jsruntime/qv4typedarray_p.h +++ b/src/qml/jsruntime/qv4typedarray_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4TYPEDARRAY_H #define QV4TYPEDARRAY_H diff --git a/src/qml/jsruntime/qv4urlobject.cpp b/src/qml/jsruntime/qv4urlobject.cpp index 6790d4c289..58df08f47d 100644 --- a/src/qml/jsruntime/qv4urlobject.cpp +++ b/src/qml/jsruntime/qv4urlobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4arrayiterator_p.h" #include "qv4urlobject_p.h" diff --git a/src/qml/jsruntime/qv4urlobject_p.h b/src/qml/jsruntime/qv4urlobject_p.h index b3b76e1158..ae3e9d8351 100644 --- a/src/qml/jsruntime/qv4urlobject_p.h +++ b/src/qml/jsruntime/qv4urlobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4URLOBJECT_P_H #define QV4URLOBJECT_P_H diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index 223a004602..ab0e8ac47f 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <qv4runtime_p.h> #include <qv4propertykey_p.h> diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 5f9481c0a1..f582fcfa71 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4VALUE_P_H #define QV4VALUE_P_H diff --git a/src/qml/jsruntime/qv4variantassociationobject.cpp b/src/qml/jsruntime/qv4variantassociationobject.cpp index defa40d2ad..b02f31d71e 100644 --- a/src/qml/jsruntime/qv4variantassociationobject.cpp +++ b/src/qml/jsruntime/qv4variantassociationobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4variantassociationobject_p.h" diff --git a/src/qml/jsruntime/qv4variantassociationobject_p.h b/src/qml/jsruntime/qv4variantassociationobject_p.h index 8abf3e3008..90091655ec 100644 --- a/src/qml/jsruntime/qv4variantassociationobject_p.h +++ b/src/qml/jsruntime/qv4variantassociationobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4VARIANTASSOCIATIONOBJECT_P_H_ #define QV4VARIANTASSOCIATIONOBJECT_P_H_ diff --git a/src/qml/jsruntime/qv4variantobject.cpp b/src/qml/jsruntime/qv4variantobject.cpp index 62e21a120c..9858046707 100644 --- a/src/qml/jsruntime/qv4variantobject.cpp +++ b/src/qml/jsruntime/qv4variantobject.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4variantobject_p.h" #include "qv4functionobject_p.h" diff --git a/src/qml/jsruntime/qv4variantobject_p.h b/src/qml/jsruntime/qv4variantobject_p.h index f2394ce9a2..4fa7f2cf6f 100644 --- a/src/qml/jsruntime/qv4variantobject_p.h +++ b/src/qml/jsruntime/qv4variantobject_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4VARIANTOBJECT_P_H #define QV4VARIANTOBJECT_P_H diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 5290b3de6e..b68f69ea5e 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qv4vme_moth_p.h" diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h index 786fc3880d..5aefe92ec7 100644 --- a/src/qml/jsruntime/qv4vme_moth_p.h +++ b/src/qml/jsruntime/qv4vme_moth_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4VME_MOTH_P_H #define QV4VME_MOTH_P_H diff --git a/src/qml/jsruntime/qv4vtable_p.h b/src/qml/jsruntime/qv4vtable_p.h index 0532fdc32d..21324cec97 100644 --- a/src/qml/jsruntime/qv4vtable_p.h +++ b/src/qml/jsruntime/qv4vtable_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4VTABLE_P_H #define QV4VTABLE_P_H diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g index c37d9b8d96..df134d6cdd 100644 --- a/src/qml/parser/qqmljs.g +++ b/src/qml/parser/qqmljs.g @@ -1,5 +1,6 @@ -- Copyright (C) 2016 The Qt Company Ltd. -- SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +-- Qt-Security score:critical reason:dataparser %parser QQmlJSGrammar %decl qqmljsparser_p.h diff --git a/src/qml/parser/qqmljsast.cpp b/src/qml/parser/qqmljsast.cpp index 09e396369a..3e08a0775f 100644 --- a/src/qml/parser/qqmljsast.cpp +++ b/src/qml/parser/qqmljsast.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <QString> #include <QLocale> diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index 59ca22593b..ba181bfcd1 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLJSAST_P_H #define QQMLJSAST_P_H diff --git a/src/qml/parser/qqmljsastfwd_p.h b/src/qml/parser/qqmljsastfwd_p.h index df64a9e1d5..6af738cfc6 100644 --- a/src/qml/parser/qqmljsastfwd_p.h +++ b/src/qml/parser/qqmljsastfwd_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant reason:forward-declarations-only #ifndef QQMLJSAST_FWD_P_H #define QQMLJSAST_FWD_P_H diff --git a/src/qml/parser/qqmljsastvisitor.cpp b/src/qml/parser/qqmljsastvisitor.cpp index 21a9e92e2c..51dda8530f 100644 --- a/src/qml/parser/qqmljsastvisitor.cpp +++ b/src/qml/parser/qqmljsastvisitor.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmljsastvisitor_p.h" diff --git a/src/qml/parser/qqmljsastvisitor_p.h b/src/qml/parser/qqmljsastvisitor_p.h index 228537ab5a..12019bcf29 100644 --- a/src/qml/parser/qqmljsastvisitor_p.h +++ b/src/qml/parser/qqmljsastvisitor_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLJSASTVISITOR_P_H #define QQMLJSASTVISITOR_P_H diff --git a/src/qml/parser/qqmljsengine_p.h b/src/qml/parser/qqmljsengine_p.h index 37f78a30e1..68208d52d2 100644 --- a/src/qml/parser/qqmljsengine_p.h +++ b/src/qml/parser/qqmljsengine_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLJSENGINE_P_H #define QQMLJSENGINE_P_H diff --git a/src/qml/parser/qqmljskeywords_p.h b/src/qml/parser/qqmljskeywords_p.h index 231e5c812d..83cbd5907f 100644 --- a/src/qml/parser/qqmljskeywords_p.h +++ b/src/qml/parser/qqmljskeywords_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #ifndef QQMLJSKEYWORDS_P_H #define QQMLJSKEYWORDS_P_H diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp index 640ab946dc..e61a615377 100644 --- a/src/qml/parser/qqmljslexer.cpp +++ b/src/qml/parser/qqmljslexer.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:dataparser #include "qqmljslexer_p.h" #include "qqmljsengine_p.h" diff --git a/src/qml/parser/qqmljslexer_p.h b/src/qml/parser/qqmljslexer_p.h index 14fba74d8c..5879a7e578 100644 --- a/src/qml/parser/qqmljslexer_p.h +++ b/src/qml/parser/qqmljslexer_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLJSLEXER_P_H #define QQMLJSLEXER_P_H diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp index 5628f14fa3..0486247d63 100644 --- a/src/qml/qml/qqml.cpp +++ b/src/qml/qml/qqml.cpp @@ -2139,8 +2139,13 @@ static bool callQObjectMethodAsVariant( QV4::Scope scope(engine); QV4::ScopedValue wrappedObject(scope, QV4::QObjectWrapper::wrap(scope.engine, thisObject)); QV4::ScopedFunctionObject function(scope, lookup->getter(scope.engine, wrappedObject)); - Q_ASSERT(function); - Q_ASSERT(lookup->asVariant); // The getter mustn't reset the isVariant flag + + // The getter mustn't reset the isVariant flag + Q_ASSERT(lookup->asVariant); + + // Since we have an asVariant lookup, the function may have been overridden in the mean time. + if (!function) + return false; Q_ALLOCA_VAR(QMetaType, types, (argc + 1) * sizeof(QMetaType)); std::fill(types, types + argc + 1, QMetaType::fromType<QVariant>()); @@ -2232,31 +2237,6 @@ static bool callArrowFunction( Q_UNREACHABLE_RETURN(false); } -static bool callArrowFunctionAsVariant( - QV4::ExecutionEngine *engine, QV4::ArrowFunction *function, - QObject *thisObject, void **args, int argc) -{ - QV4::Function *v4Function = function->function(); - Q_ASSERT(v4Function); - - switch (v4Function->kind) { - case QV4::Function::JsUntyped: - // We cannot assert anything here because the method can be shadowed. - // That's why we wrap everything in QVariant. - case QV4::Function::AotCompiled: - case QV4::Function::JsTyped: { - Q_ALLOCA_VAR(QMetaType, types, (argc + 1) * sizeof(QMetaType)); - std::fill(types, types + argc + 1, QMetaType::fromType<QVariant>()); - function->call(thisObject, args, types, argc); - return !engine->hasException; - } - case QV4::Function::Eval: - break; - } - - Q_UNREACHABLE_RETURN(false); -} - bool AOTCompiledContext::callQmlContextPropertyLookup(uint index, void **args, int argc) const { QV4::Lookup *lookup = compilationUnit->runtimeLookups + index; @@ -2436,16 +2416,25 @@ bool AOTCompiledContext::callObjectPropertyLookup( : callQObjectMethod(engine->handle(), lookup, object, args, argc); case QV4::Lookup::Call::GetterQObjectProperty: case QV4::Lookup::Call::GetterQObjectPropertyFallback: { - const bool asVariant = lookup->asVariant; - // Here we always retrieve a fresh method via the getter. No need to re-init. + if (lookup->asVariant) { + // If the method can be shadowed, the overridden method can be taken away, too. + // In that case we might end up with a QObjectMethod or random other values instead. + // callQObjectMethodAsVariant is flexible enough to handle that. + return callQObjectMethodAsVariant(engine->handle(), lookup, object, args, argc); + } + + // Here we always retrieve a fresh ArrowFunction via the getter. QV4::Scope scope(engine->handle()); QV4::ScopedValue thisObject(scope, QV4::QObjectWrapper::wrap(scope.engine, object)); QV4::Scoped<QV4::ArrowFunction> function(scope, lookup->getter(scope.engine, thisObject)); + + // The getter mustn't touch the asVariant bit + Q_ASSERT(!lookup->asVariant); + + // If the method can't be shadowed, it has to stay the same. Q_ASSERT(function); - Q_ASSERT(lookup->asVariant == asVariant); // The getter mustn't touch the asVariant bit - return asVariant - ? callArrowFunctionAsVariant(scope.engine, function, qmlScopeObject, args, argc) - : callArrowFunction(scope.engine, function, qmlScopeObject, args, argc); + + return callArrowFunction(scope.engine, function, qmlScopeObject, args, argc); } default: break; @@ -2464,16 +2453,16 @@ void AOTCompiledContext::initCallObjectPropertyLookupAsVariant(uint index, QObje QV4::Lookup *lookup = compilationUnit->runtimeLookups + index; QV4::Scope scope(engine->handle()); - const auto throwInvalidObjectError = [&]() { + const auto throwInvalidObjectError = [&](const QString &object) { scope.engine->throwTypeError( - QStringLiteral("Property '%1' of object [object Object] is not a function") - .arg(compilationUnit->runtimeStrings[lookup->nameIndex]->toQString())); + QStringLiteral("Property '%1' of object %2 is not a function").arg( + compilationUnit->runtimeStrings[lookup->nameIndex]->toQString(), object)); }; const auto *ddata = QQmlData::get(object, false); if (ddata && ddata->hasVMEMetaObject && ddata->jsWrapper.isNullOrUndefined()) { // We cannot lookup functions on an object with VME metaobject but no QObjectWrapper - throwInvalidObjectError(); + throwInvalidObjectError(QStringLiteral("[object Object]")); return; } @@ -2491,7 +2480,7 @@ void AOTCompiledContext::initCallObjectPropertyLookupAsVariant(uint index, QObje return; } - throwInvalidObjectError(); + throwInvalidObjectError(thisObject->toQStringNoThrow()); } void AOTCompiledContext::initCallObjectPropertyLookup( diff --git a/src/qmlintegration/qqmlintegration.h b/src/qmlintegration/qqmlintegration.h index 0cea1bab30..9fc42b6da1 100644 --- a/src/qmlintegration/qqmlintegration.h +++ b/src/qmlintegration/qqmlintegration.h @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:insignificant #ifndef QMLINTEGRATION_H #define QMLINTEGRATION_H diff --git a/src/qmlls/qqmlcodemodel.cpp b/src/qmlls/qqmlcodemodel.cpp index b9bf9043d5..67ec7107a0 100644 --- a/src/qmlls/qqmlcodemodel.cpp +++ b/src/qmlls/qqmlcodemodel.cpp @@ -600,15 +600,10 @@ QByteArray QQmlCodeModel::rootUrl() const return m_rootUrl; } -QStringList QQmlCodeModel::buildPathsForRootUrl(const QByteArray &url) +QStringList QQmlCodeModel::buildPaths() { QMutexLocker l(&m_mutex); - return m_buildPathsForRootUrl.value(url); -} - -static bool isNotSeparator(char c) -{ - return c != '/'; + return m_buildPaths; } QStringList QQmlCodeModel::importPathsForUrl(const QByteArray &url) @@ -668,74 +663,19 @@ static QStringList withDependentBuildDirectories(QStringList &&buildPaths) QStringList QQmlCodeModel::buildPathsForFileUrl(const QByteArray &url) { - QList<QByteArray> roots; - { - QMutexLocker l(&m_mutex); - roots = m_buildPathsForRootUrl.keys(); - } - // we want to longest match to be first, as it should override shorter matches - std::sort(roots.begin(), roots.end(), [](const QByteArray &el1, const QByteArray &el2) { - if (el1.size() > el2.size()) - return true; - if (el1.size() < el2.size()) - return false; - return el1 < el2; - }); - QStringList buildPaths; - QStringList defaultValues; - if (!roots.isEmpty() && roots.last().isEmpty()) - roots.removeLast(); - QByteArray urlSlash(url); - if (!urlSlash.isEmpty() && isNotSeparator(urlSlash.at(urlSlash.size() - 1))) - urlSlash.append('/'); - // look if the file has a know prefix path - for (const QByteArray &root : roots) { - if (urlSlash.startsWith(root)) { - buildPaths += buildPathsForRootUrl(root); - break; - } - } - QString path = url2Path(url); - - // fallback to the empty root, if is has an entry. - // This is the buildPath that is passed to qmlls via --build-dir. - if (buildPaths.isEmpty()) { - buildPaths += buildPathsForRootUrl(QByteArray()); - } - - // look in the settings. - // This is the one that is passed via the .qmlls.ini file. - if (buildPaths.isEmpty() && m_settings) { - m_settings->search(path, { QString(), verbose() }); - QString buildDir = QStringLiteral(u"buildDir"); - if (m_settings->isSet(buildDir)) - buildPaths += m_settings->value(buildDir).toString().split(QDir::listSeparator(), - Qt::SkipEmptyParts); - } - - // heuristic to find build directory - if (buildPaths.isEmpty()) { - QDir d(path); - d.setNameFilters(QStringList({ u"build*"_s })); - const int maxDirDepth = 8; - int iDir = maxDirDepth; - QString dirName = d.dirName(); - QDateTime lastModified; - while (d.cdUp() && --iDir > 0) { - for (const QFileInfo &fInfo : d.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { - if (fInfo.completeBaseName() == u"build" - || fInfo.completeBaseName().startsWith(u"build-%1"_s.arg(dirName))) { - if (iDir > 1) - iDir = 1; - if (!lastModified.isValid() || lastModified < fInfo.lastModified()) { - buildPaths.clear(); - buildPaths.append(fInfo.absoluteFilePath()); - } - } - } - } - } - return withDependentBuildDirectories(std::move(buildPaths)); + if (QStringList result = buildPaths(); !result.isEmpty()) + return withDependentBuildDirectories(std::move(result)); + + // fallback: look in the user settings (.qmlls.ini files in the source directory) + if (!m_settings || !m_settings->search(url2Path(url), { QString(), verbose() }).isValid()) + return {}; + + constexpr QLatin1String buildDir = "buildDir"_L1; + if (!m_settings->isSet(buildDir)) + return {}; + + return withDependentBuildDirectories(m_settings->value(buildDir).toString().split( + QDir::listSeparator(), Qt::SkipEmptyParts)); } void QQmlCodeModel::setDocumentationRootPath(const QString &path) @@ -749,15 +689,10 @@ void QQmlCodeModel::setDocumentationRootPath(const QString &path) m_helpManager.setDocumentationRootPath(path); } -void QQmlCodeModel::setBuildPathsForRootUrl(QByteArray url, const QStringList &paths) +void QQmlCodeModel::setBuildPaths(const QStringList &paths) { QMutexLocker l(&m_mutex); - if (!url.isEmpty() && isNotSeparator(url.at(url.size() - 1))) - url.append('/'); - if (paths.isEmpty()) - m_buildPathsForRootUrl.remove(url); - else - m_buildPathsForRootUrl.insert(url, paths); + m_buildPaths = paths; } void QQmlCodeModel::openUpdate(const QByteArray &url, UpdatePolicy policy) diff --git a/src/qmlls/qqmlcodemodel_p.h b/src/qmlls/qqmlcodemodel_p.h index 2e121789c4..21f3d4885a 100644 --- a/src/qmlls/qqmlcodemodel_p.h +++ b/src/qmlls/qqmlcodemodel_p.h @@ -118,9 +118,9 @@ public: UpdatePolicy policy); void closeOpenFile(const QByteArray &url); QByteArray rootUrl() const; - QStringList buildPathsForRootUrl(const QByteArray &url); + QStringList buildPaths(); QStringList buildPathsForFileUrl(const QByteArray &url); - void setBuildPathsForRootUrl(QByteArray url, const QStringList &paths); + void setBuildPaths(const QStringList &paths); QStringList importPathsForUrl(const QByteArray &); QStringList importPaths() const; void setImportPaths(const QStringList &paths); @@ -194,7 +194,7 @@ private: HelpManager m_helpManager; // note: access without m_mutex, has thread-safe API QHash<QByteArray, UpdatePolicy> m_openDocumentsToUpdate; - QHash<QByteArray, QStringList> m_buildPathsForRootUrl; + QStringList m_buildPaths; QHash<QByteArray, QString> m_url2path; QHash<QString, QByteArray> m_path2url; QHash<QByteArray, OpenDocument> m_openDocuments; diff --git a/src/qmlls/qqmlcodemodelmanager.cpp b/src/qmlls/qqmlcodemodelmanager.cpp index a88d93a0f5..96d39a1a7a 100644 --- a/src/qmlls/qqmlcodemodelmanager.cpp +++ b/src/qmlls/qqmlcodemodelmanager.cpp @@ -245,8 +245,8 @@ void QQmlCodeModelManager::setVerbose(bool verbose) void QQmlCodeModelManager::setBuildPathsForRootUrl(const QByteArray &url, const QStringList &paths) { - auto setBuildPaths = [&paths, this](const auto &ws) { - ws.codeModel->setBuildPathsForRootUrl(ws.url, paths); + auto setBuildPaths = [&paths, this](const QQmlWorkspace &ws) { + ws.codeModel->setBuildPaths(paths); if (const QStringList importPaths = m_buildInformation.importPathsFor(QUrl::fromEncoded(ws.url).toLocalFile()); diff --git a/src/qmlmeta/types/qqmlbind.cpp b/src/qmlmeta/types/qqmlbind.cpp index f82fb2d938..00a777065d 100644 --- a/src/qmlmeta/types/qqmlbind.cpp +++ b/src/qmlmeta/types/qqmlbind.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlbind_p.h" diff --git a/src/qmlmeta/types/qqmlbind_p.h b/src/qmlmeta/types/qqmlbind_p.h index 970f7b143d..634691778d 100644 --- a/src/qmlmeta/types/qqmlbind_p.h +++ b/src/qmlmeta/types/qqmlbind_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLBIND_H #define QQMLBIND_H diff --git a/src/qmlmeta/types/qqmlconnections.cpp b/src/qmlmeta/types/qqmlconnections.cpp index 8baefe0b8e..9754e8aba9 100644 --- a/src/qmlmeta/types/qqmlconnections.cpp +++ b/src/qmlmeta/types/qqmlconnections.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlconnections_p.h" diff --git a/src/qmlmeta/types/qqmlconnections_p.h b/src/qmlmeta/types/qqmlconnections_p.h index 84bfe1171a..fd166a571e 100644 --- a/src/qmlmeta/types/qqmlconnections_p.h +++ b/src/qmlmeta/types/qqmlconnections_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLCONNECTIONS_H #define QQMLCONNECTIONS_H diff --git a/src/qmlmeta/types/qqmllocaleenums_p.h b/src/qmlmeta/types/qqmllocaleenums_p.h index 771b74e5fb..7c96a09488 100644 --- a/src/qmlmeta/types/qqmllocaleenums_p.h +++ b/src/qmlmeta/types/qqmllocaleenums_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLLOCALEENUMS_H #define QQMLLOCALEENUMS_H diff --git a/src/qmlmeta/types/qqmlloggingcategory.cpp b/src/qmlmeta/types/qqmlloggingcategory.cpp index 2f35203701..e3c3621fb6 100644 --- a/src/qmlmeta/types/qqmlloggingcategory.cpp +++ b/src/qmlmeta/types/qqmlloggingcategory.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 Pelagicore AG // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlloggingcategory_p.h" diff --git a/src/qmlmeta/types/qqmlloggingcategory_p.h b/src/qmlmeta/types/qqmlloggingcategory_p.h index fa79383dd5..dd88645b9c 100644 --- a/src/qmlmeta/types/qqmlloggingcategory_p.h +++ b/src/qmlmeta/types/qqmlloggingcategory_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 Pelagicore AG // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLLOGGINGCATEGORY_P_H #define QQMLLOGGINGCATEGORY_P_H diff --git a/src/qmlmeta/types/qqmlmetadependencies.cpp b/src/qmlmeta/types/qqmlmetadependencies.cpp index 1023f0f468..8f398ddc03 100644 --- a/src/qmlmeta/types/qqmlmetadependencies.cpp +++ b/src/qmlmeta/types/qqmlmetadependencies.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlmetadependencies_p.h" #include <private/qtqmlglobal_p.h> diff --git a/src/qmlmeta/types/qqmlmetadependencies_p.h b/src/qmlmeta/types/qqmlmetadependencies_p.h index 2175cc2cd9..ee2e217a1c 100644 --- a/src/qmlmeta/types/qqmlmetadependencies_p.h +++ b/src/qmlmeta/types/qqmlmetadependencies_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLMETADEPENDENCIES_P_H #define QQMLMETADEPENDENCIES_P_H diff --git a/src/qmlmeta/types/qqmltimer.cpp b/src/qmlmeta/types/qqmltimer.cpp index bb7e0da7fa..d0f16d1a6e 100644 --- a/src/qmlmeta/types/qqmltimer.cpp +++ b/src/qmlmeta/types/qqmltimer.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmltimer_p.h" diff --git a/src/qmlmeta/types/qqmltimer_p.h b/src/qmlmeta/types/qqmltimer_p.h index f926262952..050ac1eeda 100644 --- a/src/qmlmeta/types/qqmltimer_p.h +++ b/src/qmlmeta/types/qqmltimer_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLTIMER_H #define QQMLTIMER_H diff --git a/src/qmlmodels/qqmlabstractdelegatecomponent.cpp b/src/qmlmodels/qqmlabstractdelegatecomponent.cpp index 709233a6c9..7fc29c825a 100644 --- a/src/qmlmodels/qqmlabstractdelegatecomponent.cpp +++ b/src/qmlmodels/qqmlabstractdelegatecomponent.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <QtQmlModels/private/qqmlabstractdelegatecomponent_p.h> #include <QtQmlModels/private/qqmladaptormodel_p.h> diff --git a/src/qmlmodels/qqmlabstractdelegatecomponent_p.h b/src/qmlmodels/qqmlabstractdelegatecomponent_p.h index ae4811dd9c..4bf522141d 100644 --- a/src/qmlmodels/qqmlabstractdelegatecomponent_p.h +++ b/src/qmlmodels/qqmlabstractdelegatecomponent_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLABSTRACTDELEGATECOMPONENT_P_H #define QQMLABSTRACTDELEGATECOMPONENT_P_H diff --git a/src/qmlmodels/qqmladaptormodel.cpp b/src/qmlmodels/qqmladaptormodel.cpp index b36b524981..59f6ae0836 100644 --- a/src/qmlmodels/qqmladaptormodel.cpp +++ b/src/qmlmodels/qqmladaptormodel.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmladaptormodel_p.h" diff --git a/src/qmlmodels/qqmladaptormodel_p.h b/src/qmlmodels/qqmladaptormodel_p.h index bc46a4a8d4..d23525e96f 100644 --- a/src/qmlmodels/qqmladaptormodel_p.h +++ b/src/qmlmodels/qqmladaptormodel_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLADAPTORMODEL_P_H #define QQMLADAPTORMODEL_P_H diff --git a/src/qmlmodels/qqmladaptormodelenginedata.cpp b/src/qmlmodels/qqmladaptormodelenginedata.cpp index dd3301d258..a471769e0a 100644 --- a/src/qmlmodels/qqmladaptormodelenginedata.cpp +++ b/src/qmlmodels/qqmladaptormodelenginedata.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qqmladaptormodelenginedata_p.h> #include <private/qqmldmlistaccessordata_p.h> diff --git a/src/qmlmodels/qqmladaptormodelenginedata_p.h b/src/qmlmodels/qqmladaptormodelenginedata_p.h index 6a4a16ab3f..f9ab77aca7 100644 --- a/src/qmlmodels/qqmladaptormodelenginedata_p.h +++ b/src/qmlmodels/qqmladaptormodelenginedata_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLADAPTORMODELENGINEDATA_P_H diff --git a/src/qmlmodels/qqmlchangeset.cpp b/src/qmlmodels/qqmlchangeset.cpp index 35fa95d6a8..6b616c5f55 100644 --- a/src/qmlmodels/qqmlchangeset.cpp +++ b/src/qmlmodels/qqmlchangeset.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlchangeset_p.h" diff --git a/src/qmlmodels/qqmlchangeset_p.h b/src/qmlmodels/qqmlchangeset_p.h index 18c4e1b8e6..17c2b116f2 100644 --- a/src/qmlmodels/qqmlchangeset_p.h +++ b/src/qmlmodels/qqmlchangeset_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLCHANGESET_P_H #define QQMLCHANGESET_P_H diff --git a/src/qmlmodels/qqmldelegatecomponent.cpp b/src/qmlmodels/qqmldelegatecomponent.cpp index 53cbde5f7e..0449308be2 100644 --- a/src/qmlmodels/qqmldelegatecomponent.cpp +++ b/src/qmlmodels/qqmldelegatecomponent.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmldelegatecomponent_p.h" #include <QtQmlModels/private/qqmladaptormodel_p.h> diff --git a/src/qmlmodels/qqmldelegatecomponent_p.h b/src/qmlmodels/qqmldelegatecomponent_p.h index 8659b4af4a..0dc4648a4b 100644 --- a/src/qmlmodels/qqmldelegatecomponent_p.h +++ b/src/qmlmodels/qqmldelegatecomponent_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLDELEGATECOMPONENT_P_H #define QQMLDELEGATECOMPONENT_P_H diff --git a/src/qmlmodels/qqmldelegatemodel.cpp b/src/qmlmodels/qqmldelegatemodel.cpp index 51c875465e..be566011e8 100644 --- a/src/qmlmodels/qqmldelegatemodel.cpp +++ b/src/qmlmodels/qqmldelegatemodel.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmldelegatemodel_p_p.h" @@ -16,6 +17,7 @@ #include <private/qqmlcomponent_p.h> #include <private/qqmlengine_p.h> #include <private/qqmlpropertytopropertybinding_p.h> +#include <private/qqmltableinstancemodel_p.h> #include <private/qquickpackage_p.h> #include <private/qv4functionobject_p.h> #include <private/qv4objectiterator_p.h> @@ -2250,11 +2252,34 @@ QQmlDelegateModelItemMetaType::QQmlDelegateModelItemMetaType( : model(model) , v4Engine(engine) , groupNames(groupNames) + , modelKind(ModelKind::DelegateModel) +{ +} + +QQmlDelegateModelItemMetaType::QQmlDelegateModelItemMetaType( + QV4::ExecutionEngine *engine, QQmlTableInstanceModel *model) + : model(model) + , v4Engine(engine) + , modelKind(ModelKind::TableInstanceModel) { } QQmlDelegateModelItemMetaType::~QQmlDelegateModelItemMetaType() = default; +void QQmlDelegateModelItemMetaType::emitModelChanged() const +{ + switch (modelKind) { + case ModelKind::InstanceModel: + break; + case ModelKind::DelegateModel: + emit static_cast<QQmlDelegateModel *>(model.data())->modelChanged(); + break; + case ModelKind::TableInstanceModel: + emit static_cast<QQmlTableInstanceModel *>(model.data())->modelChanged(); + break; + } +} + void QQmlDelegateModelItemMetaType::initializeAttachedMetaObject() { QMetaObjectBuilder builder; @@ -2417,10 +2442,11 @@ QV4::ReturnedValue QQmlDelegateModelItem::set_groups(const QV4::FunctionObject * if (!argc) THROW_TYPE_ERROR(); - if (!o->d()->item->metaType->model) + QQmlDelegateModel *delegateModel = o->d()->item->metaType->delegateModel(); + if (!delegateModel) RETURN_UNDEFINED(); - QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(o->d()->item->metaType->model); + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); const int groupFlags = model->m_cacheMetaType->parseGroups(argv[0]); const int cacheIndex = model->m_cache.indexOf(o->d()->item); Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); @@ -2435,16 +2461,16 @@ QV4::ReturnedValue QQmlDelegateModelItem::get_member(QQmlDelegateModelItem *this QV4::ReturnedValue QQmlDelegateModelItem::set_member(QQmlDelegateModelItem *cacheItem, uint flag, const QV4::Value &arg) { - if (!cacheItem->metaType->model) - return QV4::Encode::undefined(); - - QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(cacheItem->metaType->model); - bool member = arg.toBoolean(); uint groupFlag = (1 << flag); if (member == ((cacheItem->groups & groupFlag) != 0)) return QV4::Encode::undefined(); + QQmlDelegateModel *delegateModel = cacheItem->metaType->delegateModel(); + if (!delegateModel) + return QV4::Encode::undefined(); + + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); const int cacheIndex = model->m_cache.indexOf(cacheItem); Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); if (member) @@ -2510,8 +2536,8 @@ QQmlDelegateModelItem::~QQmlDelegateModelItem() Q_ASSERT(!object); if (incubationTask) { - if (metaType->model) - QQmlDelegateModelPrivate::get(metaType->model)->releaseIncubator(incubationTask); + if (QQmlDelegateModel *delegateModel = metaType->delegateModel()) + QQmlDelegateModelPrivate::get(delegateModel)->releaseIncubator(incubationTask); else delete incubationTask; } @@ -2523,10 +2549,9 @@ void QQmlDelegateModelItem::dispose() if (isReferenced()) return; - if (metaType->model) { - QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(metaType->model); - model->removeCacheItem(this); - } + if (QQmlDelegateModel *delegateModel = metaType->delegateModel()) + QQmlDelegateModelPrivate::get(delegateModel)->removeCacheItem(this); + delete this; } @@ -2607,9 +2632,8 @@ QQmlDelegateModelItem *QQmlDelegateModelItem::dataForObject(QObject *object) int QQmlDelegateModelItem::groupIndex(Compositor::Group group) { - if (QQmlDelegateModelPrivate * const model = metaType->model - ? QQmlDelegateModelPrivate::get(metaType->model) - : nullptr) { + if (QQmlDelegateModel *delegateModel = metaType->delegateModel()) { + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); return model->m_compositor.find(Compositor::Cache, model->m_cache.indexOf(this)).index[group]; } return -1; @@ -2656,9 +2680,10 @@ int QQmlDelegateModelAttachedMetaObject::metaCall(QObject *object, QMetaObject:: } } else if (call == QMetaObject::WriteProperty) { if (_id >= memberPropertyOffset) { - if (!metaType->model) + QQmlDelegateModel *delegateModel = metaType->delegateModel(); + if (!delegateModel) return -1; - QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(metaType->model); + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); Compositor::Group group = Compositor::Group(_id - memberPropertyOffset + 1); const int groupFlag = 1 << group; const bool member = attached->m_cacheItem->groups & groupFlag; @@ -2714,8 +2739,8 @@ void QQmlDelegateModelAttached::resetCurrentIndex() if (QQDMIncubationTask *incubationTask = m_cacheItem->incubationTask) { for (qsizetype i = 1, end = metaType->groupCount(); i <= end; ++i) m_currentIndex[i] = incubationTask->index[i]; - } else { - QQmlDelegateModelPrivate * const model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model); + } else if (QQmlDelegateModel *delegateModel = metaType->delegateModel()) { + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); Compositor::iterator it = model->m_compositor.find( Compositor::Cache, model->m_cache.indexOf(m_cacheItem)); for (qsizetype i = 1, end = metaType->groupCount(); i <= end; ++i) @@ -2745,9 +2770,14 @@ int QQmlDelegateModelAttached::persistedItemsIndex() const void QQmlDelegateModelAttached::setInGroup(QQmlListCompositor::Group group, bool inGroup) { - if (!(m_cacheItem && m_cacheItem->metaType && m_cacheItem->metaType->model)) + if (!m_cacheItem) + return; + + QQmlDelegateModel *delegateModel = m_cacheItem->metaType->delegateModel(); + if (!delegateModel) return; - QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model); + + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); const uint groupFlag = (1 << group); if (inGroup == bool(m_cacheItem->groups & groupFlag)) return; @@ -2791,7 +2821,7 @@ int QQmlDelegateModelAttached::itemsIndex() const QQmlDelegateModel *QQmlDelegateModelAttached::model() const { - return m_cacheItem ? m_cacheItem->metaType->model : nullptr; + return m_cacheItem ? m_cacheItem->metaType->delegateModel() : nullptr; } /*! @@ -2821,8 +2851,11 @@ void QQmlDelegateModelAttached::setGroups(const QStringList &groups) if (!m_cacheItem) return; - QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model); + QQmlDelegateModel *delegateModel = m_cacheItem->metaType->delegateModel(); + if (!delegateModel) + return; + QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(delegateModel); const int groupFlags = model->m_cacheMetaType->parseGroups(groups); const int cacheIndex = model->m_cache.indexOf(m_cacheItem); Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); @@ -3177,10 +3210,8 @@ bool QQmlDelegateModelGroupPrivate::parseIndex(const QV4::Value &value, int *ind if (object) { QQmlDelegateModelItem * const cacheItem = object->d()->item; - if (QQmlDelegateModelPrivate *model = cacheItem->metaType->model - ? QQmlDelegateModelPrivate::get(cacheItem->metaType->model) - : nullptr) { - *index = model->m_cache.indexOf(cacheItem); + if (QQmlDelegateModel *delegateModel = cacheItem->metaType->delegateModel()) { + *index = QQmlDelegateModelPrivate::get(delegateModel)->m_cache.indexOf(cacheItem); *group = Compositor::Cache; return true; } diff --git a/src/qmlmodels/qqmldelegatemodel_p.h b/src/qmlmodels/qqmldelegatemodel_p.h index efce206625..c12161f802 100644 --- a/src/qmlmodels/qqmldelegatemodel_p.h +++ b/src/qmlmodels/qqmldelegatemodel_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLDATAMODEL_P_H #define QQMLDATAMODEL_P_H diff --git a/src/qmlmodels/qqmldelegatemodel_p_p.h b/src/qmlmodels/qqmldelegatemodel_p_p.h index 367504d7fc..ea24718d43 100644 --- a/src/qmlmodels/qqmldelegatemodel_p_p.h +++ b/src/qmlmodels/qqmldelegatemodel_p_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLDATAMODEL_P_P_H #define QQMLDATAMODEL_P_P_H @@ -37,12 +38,22 @@ typedef QQmlListCompositor Compositor; class QQmlDelegateModelAttachedMetaObject; class QQmlAbstractDelegateComponent; +class QQmlTableInstanceModel; class Q_QMLMODELS_EXPORT QQmlDelegateModelItemMetaType final : public QQmlRefCounted<QQmlDelegateModelItemMetaType> { public: - QQmlDelegateModelItemMetaType(QV4::ExecutionEngine *engine, QQmlDelegateModel *model, const QStringList &groupNames); + enum class ModelKind : quint8 { + InstanceModel, + DelegateModel, + TableInstanceModel, + }; + + QQmlDelegateModelItemMetaType( + QV4::ExecutionEngine *engine, QQmlDelegateModel *model, const QStringList &groupNames); + QQmlDelegateModelItemMetaType( + QV4::ExecutionEngine *engine, QQmlTableInstanceModel *model); ~QQmlDelegateModelItemMetaType(); void initializeAttachedMetaObject(); @@ -51,12 +62,23 @@ public: int parseGroups(const QStringList &groupNames) const; int parseGroups(const QV4::Value &groupNames) const; - QPointer<QQmlDelegateModel> model; + QQmlDelegateModel *delegateModel() const + { + return modelKind == ModelKind::DelegateModel + ? static_cast<QQmlDelegateModel *>(model.get()) + : nullptr; + } + qsizetype groupCount() const { return groupNames.size(); } + + void emitModelChanged() const; + + QPointer<QQmlInstanceModel> model; QV4::ExecutionEngine * const v4Engine; QQmlRefPointer<QQmlDelegateModelAttachedMetaObject> attachedMetaObject; const QStringList groupNames; QV4::PersistentValue modelItemProto; + ModelKind modelKind = ModelKind::InstanceModel; }; class QQmlAdaptorModel; diff --git a/src/qmlmodels/qqmldmabstractitemmodeldata.cpp b/src/qmlmodels/qqmldmabstractitemmodeldata.cpp index fb213e2762..2ca8efd25f 100644 --- a/src/qmlmodels/qqmldmabstractitemmodeldata.cpp +++ b/src/qmlmodels/qqmldmabstractitemmodeldata.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qqmldmabstractitemmodeldata_p.h> diff --git a/src/qmlmodels/qqmldmabstractitemmodeldata_p.h b/src/qmlmodels/qqmldmabstractitemmodeldata_p.h index b213c7d664..7fab145e1e 100644 --- a/src/qmlmodels/qqmldmabstractitemmodeldata_p.h +++ b/src/qmlmodels/qqmldmabstractitemmodeldata_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLDMABSTRACTITEMMODELDATA_P_H #define QQMLDMABSTRACTITEMMODELDATA_P_H diff --git a/src/qmlmodels/qqmldmlistaccessordata.cpp b/src/qmlmodels/qqmldmlistaccessordata.cpp index 99e1612f80..c274ee6485 100644 --- a/src/qmlmodels/qqmldmlistaccessordata.cpp +++ b/src/qmlmodels/qqmldmlistaccessordata.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qqmldmlistaccessordata_p.h> @@ -99,8 +100,7 @@ int VDMListDelegateDataType::metaCall( accessor->cachedDataClean = false; } else { model->list.set(accessor->index, data); - if (QQmlDelegateModel *delegateModel = accessor->metaType->model) - emit delegateModel->modelChanged(); + accessor->metaType->emitModelChanged(); } QMetaObject::activate(accessor, this, id - propertyOffset, nullptr); emit accessor->modelDataChanged(); diff --git a/src/qmlmodels/qqmldmlistaccessordata_p.h b/src/qmlmodels/qqmldmlistaccessordata_p.h index bde5dd30cb..d1e6be74a2 100644 --- a/src/qmlmodels/qqmldmlistaccessordata_p.h +++ b/src/qmlmodels/qqmldmlistaccessordata_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLDMLISTACCESSORDATA_P_H #define QQMLDMLISTACCESSORDATA_P_H diff --git a/src/qmlmodels/qqmldmobjectdata.cpp b/src/qmlmodels/qqmldmobjectdata.cpp index 3e6887be3e..3d57b541ea 100644 --- a/src/qmlmodels/qqmldmobjectdata.cpp +++ b/src/qmlmodels/qqmldmobjectdata.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <private/qqmldmobjectdata_p.h> diff --git a/src/qmlmodels/qqmldmobjectdata_p.h b/src/qmlmodels/qqmldmobjectdata_p.h index 05901cc100..7a7f0a6baf 100644 --- a/src/qmlmodels/qqmldmobjectdata_p.h +++ b/src/qmlmodels/qqmldmobjectdata_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLDMOBJECTDATA_P_H #define QQMLDMOBJECTDATA_P_H diff --git a/src/qmlmodels/qqmlinstantiator.cpp b/src/qmlmodels/qqmlinstantiator.cpp index b4dfd5e42e..3ccfa7ad58 100644 --- a/src/qmlmodels/qqmlinstantiator.cpp +++ b/src/qmlmodels/qqmlinstantiator.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 Research In Motion. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlinstantiator_p.h" #include "qqmlinstantiator_p_p.h" diff --git a/src/qmlmodels/qqmlinstantiator_p.h b/src/qmlmodels/qqmlinstantiator_p.h index d59f27d758..40250963d5 100644 --- a/src/qmlmodels/qqmlinstantiator_p.h +++ b/src/qmlmodels/qqmlinstantiator_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 Research In Motion. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLINSTANTIATOR_P_H #define QQMLINSTANTIATOR_P_H diff --git a/src/qmlmodels/qqmlinstantiator_p_p.h b/src/qmlmodels/qqmlinstantiator_p_p.h index 9001b2f9f4..1a72edb7b8 100644 --- a/src/qmlmodels/qqmlinstantiator_p_p.h +++ b/src/qmlmodels/qqmlinstantiator_p_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 Research In Motion. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLINSTANTIATOR_P_P_H #define QQMLINSTANTIATOR_P_P_H diff --git a/src/qmlmodels/qqmllistaccessor.cpp b/src/qmlmodels/qqmllistaccessor.cpp index 7483c07056..aac1b8bfc1 100644 --- a/src/qmlmodels/qqmllistaccessor.cpp +++ b/src/qmlmodels/qqmllistaccessor.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmllistaccessor_p.h" diff --git a/src/qmlmodels/qqmllistaccessor_p.h b/src/qmlmodels/qqmllistaccessor_p.h index 4d61e537e8..1fc2dda7e5 100644 --- a/src/qmlmodels/qqmllistaccessor_p.h +++ b/src/qmlmodels/qqmllistaccessor_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLLISTACCESSOR_H #define QQMLLISTACCESSOR_H diff --git a/src/qmlmodels/qqmllistcompositor.cpp b/src/qmlmodels/qqmllistcompositor.cpp index de8d3b6105..836d57c735 100644 --- a/src/qmlmodels/qqmllistcompositor.cpp +++ b/src/qmlmodels/qqmllistcompositor.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmllistcompositor_p.h" diff --git a/src/qmlmodels/qqmllistcompositor_p.h b/src/qmlmodels/qqmllistcompositor_p.h index 99b9acd0e5..e62cb49eae 100644 --- a/src/qmlmodels/qqmllistcompositor_p.h +++ b/src/qmlmodels/qqmllistcompositor_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLLISTCOMPOSITOR_P_H #define QQMLLISTCOMPOSITOR_P_H diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp index ca8418a3b1..b30db8aeaf 100644 --- a/src/qmlmodels/qqmllistmodel.cpp +++ b/src/qmlmodels/qqmllistmodel.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmllistmodel_p_p.h" #include "qqmllistmodelworkeragent_p.h" diff --git a/src/qmlmodels/qqmllistmodel_p.h b/src/qmlmodels/qqmllistmodel_p.h index f96b264abd..72924a2523 100644 --- a/src/qmlmodels/qqmllistmodel_p.h +++ b/src/qmlmodels/qqmllistmodel_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLLISTMODEL_H #define QQMLLISTMODEL_H diff --git a/src/qmlmodels/qqmllistmodel_p_p.h b/src/qmlmodels/qqmllistmodel_p_p.h index 28ebe218da..36c0873e41 100644 --- a/src/qmlmodels/qqmllistmodel_p_p.h +++ b/src/qmlmodels/qqmllistmodel_p_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2020 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLLISTMODEL_P_P_H #define QQMLLISTMODEL_P_P_H diff --git a/src/qmlmodels/qqmllistmodelworkeragent.cpp b/src/qmlmodels/qqmllistmodelworkeragent.cpp index c50296b1f5..e1c7eec9c2 100644 --- a/src/qmlmodels/qqmllistmodelworkeragent.cpp +++ b/src/qmlmodels/qqmllistmodelworkeragent.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmllistmodelworkeragent_p.h" #include "qqmllistmodel_p_p.h" diff --git a/src/qmlmodels/qqmllistmodelworkeragent_p.h b/src/qmlmodels/qqmllistmodelworkeragent_p.h index 647cc1b997..7c4b6af077 100644 --- a/src/qmlmodels/qqmllistmodelworkeragent_p.h +++ b/src/qmlmodels/qqmllistmodelworkeragent_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQUICKLISTMODELWORKERAGENT_P_H #define QQUICKLISTMODELWORKERAGENT_P_H diff --git a/src/qmlmodels/qqmlmodelindexvaluetype.cpp b/src/qmlmodels/qqmlmodelindexvaluetype.cpp index 14160bd572..5334c15896 100644 --- a/src/qmlmodels/qqmlmodelindexvaluetype.cpp +++ b/src/qmlmodels/qqmlmodelindexvaluetype.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlmodelindexvaluetype_p.h" diff --git a/src/qmlmodels/qqmlmodelindexvaluetype_p.h b/src/qmlmodels/qqmlmodelindexvaluetype_p.h index 35ebacc051..4219843c07 100644 --- a/src/qmlmodels/qqmlmodelindexvaluetype_p.h +++ b/src/qmlmodels/qqmlmodelindexvaluetype_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLMODELINDEXVALUETYPE_P_H #define QQMLMODELINDEXVALUETYPE_P_H diff --git a/src/qmlmodels/qqmlmodelsmodule.cpp b/src/qmlmodels/qqmlmodelsmodule.cpp index 19da8fa829..a8d3fb5ba3 100644 --- a/src/qmlmodels/qqmlmodelsmodule.cpp +++ b/src/qmlmodels/qqmlmodelsmodule.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:insignificant #include "qqmlmodelsmodule_p.h" diff --git a/src/qmlmodels/qqmlmodelsmodule_p.h b/src/qmlmodels/qqmlmodelsmodule_p.h index 653e444fb5..64e015c264 100644 --- a/src/qmlmodels/qqmlmodelsmodule_p.h +++ b/src/qmlmodels/qqmlmodelsmodule_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 Research In Motion. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLMODELSMODULE_H #define QQMLMODELSMODULE_H diff --git a/src/qmlmodels/qqmlobjectmodel.cpp b/src/qmlmodels/qqmlobjectmodel.cpp index de8f84d220..433d4a41c9 100644 --- a/src/qmlmodels/qqmlobjectmodel.cpp +++ b/src/qmlmodels/qqmlobjectmodel.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmlobjectmodel_p.h" diff --git a/src/qmlmodels/qqmlobjectmodel_p.h b/src/qmlmodels/qqmlobjectmodel_p.h index 74b9355605..c6d50559c8 100644 --- a/src/qmlmodels/qqmlobjectmodel_p.h +++ b/src/qmlmodels/qqmlobjectmodel_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLINSTANCEMODEL_P_H #define QQMLINSTANCEMODEL_P_H diff --git a/src/qmlmodels/qqmltableinstancemodel.cpp b/src/qmlmodels/qqmltableinstancemodel.cpp index 77564e3fe7..3f2dd3fe8c 100644 --- a/src/qmlmodels/qqmltableinstancemodel.cpp +++ b/src/qmlmodels/qqmltableinstancemodel.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qqmltableinstancemodel_p.h" #include "qqmlabstractdelegatecomponent_p.h" @@ -36,8 +37,8 @@ void QQmlTableInstanceModel::deleteModelItemLater(QQmlDelegateModelItem *modelIt QQmlTableInstanceModel::QQmlTableInstanceModel(QQmlContext *qmlContext, QObject *parent) : QQmlInstanceModel(*(new QObjectPrivate()), parent) , m_qmlContext(qmlContext) - , m_metaType(new QQmlDelegateModelItemMetaType(m_qmlContext->engine()->handle(), nullptr, QStringList()), - QQmlRefPointer<QQmlDelegateModelItemMetaType>::Adopt) + , m_metaType(QQml::makeRefPointer<QQmlDelegateModelItemMetaType>( + m_qmlContext->engine()->handle(), this)) { } @@ -452,7 +453,7 @@ QVariant QQmlTableInstanceModel::model() const return m_adaptorModel.model(); } -void QQmlTableInstanceModel::setModel(const QVariant &model) +void QQmlTableInstanceModel::forceSetModel(const QVariant &model) { // Pooled items are still accessible/alive for the application, and // needs to stay in sync with the model. So we need to drain the pool @@ -469,6 +470,16 @@ void QQmlTableInstanceModel::setModel(const QVariant &model) } } +void QQmlTableInstanceModel::setModel(const QVariant &model) +{ + if (m_adaptorModel.model() == model) + return; + + forceSetModel(model); + + emit modelChanged(); +} + void QQmlTableInstanceModel::dataChangedCallback(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles) { // This function is called when model data has changed. In that case, we tell the adaptor model @@ -494,8 +505,11 @@ void QQmlTableInstanceModel::modelAboutToBeResetCallback() auto const aim = abstractItemModel(); auto oldRoleNames = aim->roleNames(); QObject::connect(aim, &QAbstractItemModel::modelReset, this, [this, aim, oldRoleNames](){ - if (oldRoleNames != aim->roleNames()) - setModel(model()); + if (oldRoleNames != aim->roleNames()) { + // We refresh the model, but without sending any signals. The actual model object + // stays the same after all. + forceSetModel(model()); + } }, Qt::SingleShotConnection); } diff --git a/src/qmlmodels/qqmltableinstancemodel_p.h b/src/qmlmodels/qqmltableinstancemodel_p.h index eabb0e2067..326c30c04f 100644 --- a/src/qmlmodels/qqmltableinstancemodel_p.h +++ b/src/qmlmodels/qqmltableinstancemodel_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQMLTABLEINSTANCEMODEL_P_H #define QQMLTABLEINSTANCEMODEL_P_H @@ -102,6 +103,9 @@ public: QQmlDelegateModelItem *getModelItem(int index); +signals: + void modelChanged(); + private: enum DestructionMode { Deferred, @@ -129,6 +133,7 @@ private: void dataChangedCallback(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles); void modelAboutToBeResetCallback(); + void forceSetModel(const QVariant &model); static bool isDoneIncubating(QQmlDelegateModelItem *modelItem); static void deleteModelItemLater(QQmlDelegateModelItem *modelItem); diff --git a/src/qmlmodels/qqmltreemodeltotablemodel.cpp b/src/qmlmodels/qqmltreemodeltotablemodel.cpp index 95d793a8c9..5adf4ffa68 100644 --- a/src/qmlmodels/qqmltreemodeltotablemodel.cpp +++ b/src/qmlmodels/qqmltreemodeltotablemodel.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include <math.h> #include <QtCore/qstack.h> diff --git a/src/qmlmodels/qqmltreemodeltotablemodel_p_p.h b/src/qmlmodels/qqmltreemodeltotablemodel_p_p.h index 2b38f3726b..f945034e92 100644 --- a/src/qmlmodels/qqmltreemodeltotablemodel_p_p.h +++ b/src/qmlmodels/qqmltreemodeltotablemodel_p_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2021 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQmlTreeModelToTableModel_H #define QQmlTreeModelToTableModel_H diff --git a/src/qmlmodels/qquickpackage.cpp b/src/qmlmodels/qquickpackage.cpp index be86572698..dfe0ddfc44 100644 --- a/src/qmlmodels/qquickpackage.cpp +++ b/src/qmlmodels/qquickpackage.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qquickpackage_p.h" diff --git a/src/qmlmodels/qquickpackage_p.h b/src/qmlmodels/qquickpackage_p.h index 827d718248..7bd9e87743 100644 --- a/src/qmlmodels/qquickpackage_p.h +++ b/src/qmlmodels/qquickpackage_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQUICKPACKAGE_H #define QQUICKPACKAGE_H diff --git a/src/qmlmodels/qtqmlmodelsglobal.h b/src/qmlmodels/qtqmlmodelsglobal.h index 02bfb07e84..5c4f2d86c2 100644 --- a/src/qmlmodels/qtqmlmodelsglobal.h +++ b/src/qmlmodels/qtqmlmodelsglobal.h @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:insignificant #ifndef QTQMLMODELSGLOBAL_H #define QTQMLMODELSGLOBAL_H diff --git a/src/qmlmodels/qtqmlmodelsglobal_p.h b/src/qmlmodels/qtqmlmodelsglobal_p.h index 966836ec6b..7f777d8d05 100644 --- a/src/qmlmodels/qtqmlmodelsglobal_p.h +++ b/src/qmlmodels/qtqmlmodelsglobal_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:insignificant #ifndef QTQMLMODELSGLOBAL_P_H #define QTQMLMODELSGLOBAL_P_H diff --git a/src/qmlworkerscript/qquickworkerscript.cpp b/src/qmlworkerscript/qquickworkerscript.cpp index 732c272582..bd4be32529 100644 --- a/src/qmlworkerscript/qquickworkerscript.cpp +++ b/src/qmlworkerscript/qquickworkerscript.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #include "qtqmlworkerscriptglobal_p.h" #include "qquickworkerscript_p.h" diff --git a/src/qmlworkerscript/qquickworkerscript_p.h b/src/qmlworkerscript/qquickworkerscript_p.h index ad2b958c6d..a831f86132 100644 --- a/src/qmlworkerscript/qquickworkerscript_p.h +++ b/src/qmlworkerscript/qquickworkerscript_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QQUICKWORKERSCRIPT_P_H #define QQUICKWORKERSCRIPT_P_H diff --git a/src/qmlworkerscript/qtqmlworkerscriptglobal.h b/src/qmlworkerscript/qtqmlworkerscriptglobal.h index 1156b27b2d..896d6e0e55 100644 --- a/src/qmlworkerscript/qtqmlworkerscriptglobal.h +++ b/src/qmlworkerscript/qtqmlworkerscriptglobal.h @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:insignificant #ifndef QTQMLWORKERSCRIPTGLOBAL_H #define QTQMLWORKERSCRIPTGLOBAL_H diff --git a/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h b/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h index e0810f40cb..72d169df91 100644 --- a/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h +++ b/src/qmlworkerscript/qtqmlworkerscriptglobal_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2019 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:insignificant #ifndef QTQMLWORKERSCRIPTGLOBAL_P_H #define QTQMLWORKERSCRIPTGLOBAL_P_H diff --git a/src/qmlworkerscript/qv4serialize.cpp b/src/qmlworkerscript/qv4serialize.cpp index cacaf1b0dd..38a857404d 100644 --- a/src/qmlworkerscript/qv4serialize.cpp +++ b/src/qmlworkerscript/qv4serialize.cpp @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:critical reason:data-parser #include "qv4serialize_p.h" diff --git a/src/qmlworkerscript/qv4serialize_p.h b/src/qmlworkerscript/qv4serialize_p.h index 226557a2af..a3de8ed1b9 100644 --- a/src/qmlworkerscript/qv4serialize_p.h +++ b/src/qmlworkerscript/qv4serialize_p.h @@ -1,5 +1,6 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +// Qt-Security score:significant #ifndef QV4SERIALIZE_P_H #define QV4SERIALIZE_P_H diff --git a/src/quick/doc/images/path-ellipseshape.png b/src/quick/doc/images/path-ellipseshape.png Binary files differnew file mode 100644 index 0000000000..17448dd0b8 --- /dev/null +++ b/src/quick/doc/images/path-ellipseshape.png diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 6c8ace80e6..56e5819080 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -4573,12 +4573,17 @@ void QQuickTableViewPrivate::syncDelegateModelAccess() QVariant QQuickTableViewPrivate::modelImpl() const { - return assignedModel; + if (needsModelSynchronization) + return assignedModel; + if (tableModel) + return tableModel->model(); + return QVariant::fromValue(model); } void QQuickTableViewPrivate::setModelImpl(const QVariant &newModel) { assignedModel = newModel; + needsModelSynchronization = true; scheduleRebuildTable(QQuickTableViewPrivate::RebuildOption::All); emit q_func()->modelChanged(); } @@ -4612,6 +4617,7 @@ void QQuickTableViewPrivate::syncModel() tableModel->setModel(assignedModel); } + needsModelSynchronization = false; connectToModel(); } @@ -4748,6 +4754,11 @@ void QQuickTableViewPrivate::connectToModel() } else { QObjectPrivate::connect(model, &QQmlInstanceModel::modelUpdated, this, &QQuickTableViewPrivate::modelUpdated); } + + if (tableModel) { + QObject::connect(tableModel, &QQmlTableInstanceModel::modelChanged, + q, &QQuickTableView::modelChanged); + } } void QQuickTableViewPrivate::disconnectFromModel() @@ -4774,6 +4785,11 @@ void QQuickTableViewPrivate::disconnectFromModel() } else { QObjectPrivate::disconnect(model, &QQmlInstanceModel::modelUpdated, this, &QQuickTableViewPrivate::modelUpdated); } + + if (tableModel) { + QObject::disconnect(tableModel, &QQmlTableInstanceModel::modelChanged, + q, &QQuickTableView::modelChanged); + } } void QQuickTableViewPrivate::modelUpdated(const QQmlChangeSet &changeSet, bool reset) diff --git a/src/quick/items/qquicktableview_p_p.h b/src/quick/items/qquicktableview_p_p.h index 3db877e4a3..4cdd94f3d3 100644 --- a/src/quick/items/qquicktableview_p_p.h +++ b/src/quick/items/qquicktableview_p_p.h @@ -427,6 +427,7 @@ public: QItemSelectionModel::SelectionFlag selectionFlag = QItemSelectionModel::NoUpdate; std::function<void(CallBackFlag)> selectableCallbackFunction; bool inSelectionModelUpdate = false; + bool needsModelSynchronization = false; int assignedPositionViewAtRowAfterRebuild = 0; int assignedPositionViewAtColumnAfterRebuild = 0; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 60c4c1633e..f1b131e7e9 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -817,14 +817,16 @@ void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control) animationController.reset(new QQuickAnimatorController(q)); - QObject::connect(context, &QSGRenderContext::initialized, q, &QQuickWindow::sceneGraphInitialized, Qt::DirectConnection); - QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::sceneGraphInvalidated, Qt::DirectConnection); - QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::cleanupSceneGraph, Qt::DirectConnection); + connections = { + QObject::connect(context, &QSGRenderContext::initialized, q, &QQuickWindow::sceneGraphInitialized, Qt::DirectConnection), + QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::sceneGraphInvalidated, Qt::DirectConnection), + QObject::connect(context, &QSGRenderContext::invalidated, q, &QQuickWindow::cleanupSceneGraph, Qt::DirectConnection), - QObject::connect(q, &QQuickWindow::focusObjectChanged, q, &QQuickWindow::activeFocusItemChanged); - QObject::connect(q, &QQuickWindow::screenChanged, q, &QQuickWindow::handleScreenChanged); - QObject::connect(qApp, &QGuiApplication::applicationStateChanged, q, &QQuickWindow::handleApplicationStateChanged); - QObject::connect(q, &QQuickWindow::frameSwapped, q, &QQuickWindow::runJobsAfterSwap, Qt::DirectConnection); + QObject::connect(q, &QQuickWindow::focusObjectChanged, q, &QQuickWindow::activeFocusItemChanged), + QObject::connect(q, &QQuickWindow::screenChanged, q, &QQuickWindow::handleScreenChanged), + QObject::connect(qApp, &QGuiApplication::applicationStateChanged, q, &QQuickWindow::handleApplicationStateChanged), + QObject::connect(q, &QQuickWindow::frameSwapped, q, &QQuickWindow::runJobsAfterSwap, Qt::DirectConnection), + }; if (QQmlInspectorService *service = QQmlDebugConnector::service<QQmlInspectorService>()) service->addWindow(q); @@ -1213,6 +1215,9 @@ QQuickWindow::~QQuickWindow() // have their destructors loaded while they the library is still // loaded into memory. QQuickPixmap::purgeCache(); + + for (const QMetaObject::Connection &connection : d->connections) + disconnect(connection); } #if QT_CONFIG(quick_shadereffect) diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index f4769a8c7f..8da8b0b6c0 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -194,6 +194,7 @@ public: qreal lastReportedItemDevicePixelRatio; QMetaObject::Connection physicalDpiChangedConnection; + std::array<QMetaObject::Connection, 7> connections; void updateDirtyNodes(); void cleanupNodes(); diff --git a/src/quick/util/qquickdeliveryagent.cpp b/src/quick/util/qquickdeliveryagent.cpp index df00dea43d..168cc3afaa 100644 --- a/src/quick/util/qquickdeliveryagent.cpp +++ b/src/quick/util/qquickdeliveryagent.cpp @@ -2417,7 +2417,10 @@ bool QQuickDeliveryAgentPrivate::deliverPressOrReleaseEvent(QPointerEvent *event handlersOnly = true; } - return event->allPointsAccepted(); + // Return this because it's true if all events were accepted, rather than + // event->allPointsAccepted(), which can be false even if the event was accepted, because the + // event points' accepted states are set to false before delivery. + return handlersOnly; } /*! \internal diff --git a/src/quickshapes/designhelpers/CMakeLists.txt b/src/quickshapes/designhelpers/CMakeLists.txt index 72d0fd2d2d..8f23b53381 100644 --- a/src/quickshapes/designhelpers/CMakeLists.txt +++ b/src/quickshapes/designhelpers/CMakeLists.txt @@ -10,6 +10,9 @@ qt_internal_add_qml_module(QuickShapesDesignHelpersPrivate QtQuick/auto INTERNAL_MODULE SOURCES + qquickellipseshape.cpp + qquickellipseshape_p.h + qquickellipseshape_p_p.h qquickrectangleshape.cpp qquickrectangleshape_p.h qquickrectangleshape_p_p.h diff --git a/src/quickshapes/designhelpers/doc/snippets/ellipseshape.qml b/src/quickshapes/designhelpers/doc/snippets/ellipseshape.qml new file mode 100644 index 0000000000..d1edda2110 --- /dev/null +++ b/src/quickshapes/designhelpers/doc/snippets/ellipseshape.qml @@ -0,0 +1,23 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +import QtQuick +import QtQuick.Shapes + +Window { + visible: true + flags: Qt.FramelessWindowHint + width: 100 + height: 100 + +//! [ellipseShape] + EllipseShape { + id: ellipseShape + anchors.fill: parent + width: 90 + height: 90 + startAngle: 0 + sweepAngle: 270 + } +//! [ellipseShape] +} diff --git a/src/quickshapes/designhelpers/qquickellipseshape.cpp b/src/quickshapes/designhelpers/qquickellipseshape.cpp new file mode 100644 index 0000000000..9cad9502c0 --- /dev/null +++ b/src/quickshapes/designhelpers/qquickellipseshape.cpp @@ -0,0 +1,999 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "qquickellipseshape_p.h" +#include "qquickellipseshape_p_p.h" +#include <algorithm> +#include <QtMath> + +QT_BEGIN_NAMESPACE + +namespace { +inline bool is_equal(qreal a, qreal b, qreal epsilon = DBL_EPSILON) +{ + return std::fabs(a - b) <= epsilon; +} + +inline qreal arc_angle(qreal angle) +{ + return angle - 90; +} + +inline QVector2D arc_point(QVector2D center, QVector2D radius, qreal angle) +{ + return QVector2D(center.x() + radius.x() * qCos(qDegreesToRadians(angle)), + center.y() + radius.y() * qSin(qDegreesToRadians(angle))); +} + +// counter-clockwise +inline QVector2D tangent_ccw(QVector2D radius, qreal angle) +{ + return QVector2D(-radius.x() * qSin(qDegreesToRadians(angle)), + radius.y() * qCos(qDegreesToRadians(angle))); +} + +inline qreal cross(QVector2D a, QVector2D b) +{ + return a.x() * b.y() - a.y() * b.x(); +} + +// cross product of two vectors defined by points A->B x C->D +inline qreal cross(QVector2D a, QVector2D b, QVector2D c, QVector2D d) +{ + return cross(b - a, d - c); +} + +qreal angle_between_vectors(QVector2D a, QVector2D b) +{ + const QVector2D uA = a.normalized(); + const QVector2D uB = b.normalized(); + const qreal angle = qAtan2(cross(uA, uB), QVector2D::dotProduct(uA, uB)); + if (std::fabs(angle) < FLT_EPSILON) + return 0.0f; + return angle; +} + +// the intersection point can be calculated as C + T * (D - C) or A + S * (B - A) +bool lines_intersect(QVector2D a, QVector2D b, QVector2D c, QVector2D d, qreal *s, qreal *t) +{ + // lines undefined + if ((a.x() == b.x() && a.y() == b.y()) || (c.x() == d.x() && c.y() == d.y())) + return false; + + const qreal denom = cross(a, b, c, d); + + // lines are parallel or overlap + if (denom == 0) + return false; + + if (s != nullptr) + *s = cross(c, d, c, a) / denom; + if (t != nullptr) + *t = cross(a, b, c, a) / denom; + + return true; +} +} // namespace + +QQuickEllipseShapePrivate::QQuickEllipseShapePrivate() = default; + +QQuickEllipseShapePrivate::~QQuickEllipseShapePrivate() = default; + +void QQuickEllipseShapePrivate::addLine(QVector2D point) +{ + auto line = new QQuickPathLine(path); + line->setX(point.x()); + line->setY(point.y()); + QQuickPathPrivate::get(path)->appendPathElement(line); +} + +void QQuickEllipseShapePrivate::addArc(QVector2D point, QVector2D arcRadius, + QQuickPathArc::ArcDirection dir, bool largeArc) +{ + auto arc = new QQuickPathArc(path); + arc->setX(point.x()); + arc->setY(point.y()); + arc->setRadiusX(arcRadius.x()); + arc->setRadiusY(arcRadius.y()); + arc->setDirection(dir); + arc->setUseLargeArc(largeArc); + QQuickPathPrivate::get(path)->appendPathElement(arc); +} + +qreal QQuickEllipseShapePrivate::getBorderOffset() const +{ + if (QQuickEllipseShape::BorderMode::Middle == borderMode) + return 0; + else if (QQuickEllipseShape::BorderMode::Outside == borderMode) + return -path->strokeWidth() * 0.5; + return path->strokeWidth() * 0.5f; // inside +} + +void QQuickEllipseShapePrivate::roundCenter(QVector2D center, QVector2D ellipseRadius) +{ + const qreal endAngle = arc_angle(startAngle + sweepAngle); + const QVector2D endPoint = arc_point(center, ellipseRadius, endAngle); + const qreal beginAngle = arc_angle(startAngle); + const QVector2D beginPoint = arc_point(center, ellipseRadius, beginAngle); + + const QVector2D AB = endPoint - center; + const QVector2D AC = beginPoint - center; + + const qreal a = angle_between_vectors(AB, AC); + const qreal halfAngle = std::fabs(a) * 0.5f; + + const qreal maxCornerRadius = (std::min(AB.length(), AC.length()) * 0.5f) * qTan(halfAngle); + const qreal corner_radius = std::min(cornerRadius, maxCornerRadius); + + // calculate B and C based on the corner radius + const qreal edgeOffset = corner_radius / qTan(halfAngle); + const QVector2D B = center + (AB.normalized() * edgeOffset); + const QVector2D C = center + (AC.normalized() * edgeOffset); + + // update + auto &rc = roundedCorners[RoundedCornerIndex::Center]; + rc.A = center; + rc.B = B; + rc.C = C; + rc.alpha = a; + rc.radius = corner_radius; +} + +void QQuickEllipseShapePrivate::roundBeginEnd(QVector2D center, QVector2D ellipseRadius) +{ + qreal deg = 0.0f; + const qreal endAngle = startAngle + sweepAngle; + bool e_outer = false, b_outer = false, e_inner = false, b_inner = false; + while (deg < 45.0f) { + deg += 1.0f; + if (e_outer && b_outer && e_inner && b_inner) + break; + if (!b_outer) + b_outer = roundOuter(center, ellipseRadius, deg, startAngle, endAngle, + RoundedCornerIndex::OuterBegin); + if (!e_outer) + e_outer = roundOuter(center, ellipseRadius, deg, endAngle, startAngle, + RoundedCornerIndex::OuterEnd); + if (!e_inner) + e_inner = roundInner(center, ellipseRadius, deg, endAngle, startAngle, + RoundedCornerIndex::InnerEnd); + if (!b_inner) + b_inner = roundInner(center, ellipseRadius, deg, startAngle, endAngle, + RoundedCornerIndex::InnerBegin); + } +} + +bool QQuickEllipseShapePrivate::roundOuter(QVector2D center, QVector2D ellipseRadius, qreal deg, + qreal arcAngle1, qreal arcAngle2, + RoundedCornerIndex index) +{ + bool done = false; + + const qreal arcAngle = arc_angle(arcAngle1); + const QVector2D arcPoint = arc_point(center, ellipseRadius, arcAngle); + + const qreal angle = arcAngle1 > arcAngle2 ? arcAngle - deg : arcAngle + deg; + + const QVector2D B = arc_point(center, ellipseRadius, angle); // point on arc + + // calculate tangent vector + const QVector2D uV = tangent_ccw(ellipseRadius, angle).normalized(); + const QVector2D b1 = B + uV; + + qreal s = 0, t = 0; + bool res = lines_intersect(center, arcPoint, B, b1, &s, &t); + if (res) { + const QVector2D A = center + s * (arcPoint - center); + + const QVector2D AB = B - A; + const QVector2D AC = center - A; + + const qreal a = angle_between_vectors(AB, AC); + const qreal halfAngle = std::fabs(a) * 0.5; + const qreal edgeOffset = AB.length(); + + const qreal corner_radius = edgeOffset * qTan(halfAngle); + + // constrain by sweep + const qreal sweep = std::fabs(arcAngle2 - arcAngle1) * 0.5; + const qreal degMax = std::min(sweep, 45.0); + + const QVector2D C = A + AC.normalized() * edgeOffset; + + const qreal ptoc = (arcPoint - C).length(); + qreal edge = 0; + if (innerArcRatio > 0) { + const QVector2D ellipseInnerRadius(innerArcRatio * ellipseRadius.x(), + innerArcRatio * ellipseRadius.y()); + const QVector2D innerArcPoint = + arc_point(center, ellipseInnerRadius, arcAngle); // point on the inner arc + edge = (arcPoint - innerArcPoint).length(); + } else { + edge = (arcPoint - center).length(); + } + + const qreal diff = std::fabs(corner_radius - cornerRadius); // closest to target radius + + auto &rc = roundedCorners[index]; + + bool canUpdate = diff < rc.diff && !(corner_radius > cornerRadius) && !(deg > degMax) + && !(rc.radius > corner_radius) && !(ptoc > edge * 0.5f); + + // 1st loop or if constraints are met + if (rc.radius == 0 || canUpdate) + rc.update(diff, A, B, C, a, corner_radius); + + done = + // corner radius is bigger or equal to the target radius + corner_radius > cornerRadius + || is_equal(corner_radius, cornerRadius, 0.01f) + // angle used to define point B is bigger than available sweep + || deg > degMax + || is_equal(deg, degMax, 0.01f) + // the corner radius starts to decline (from previously calculated) + || (rc.radius != 0 && rc.radius > corner_radius) + // point C is beyond the half of the ellipse edge + // (closer to the ellipse center or inner arc point) + || (ptoc > edge * 0.5f); + } + + return done; +} + +bool QQuickEllipseShapePrivate::roundInner(QVector2D center, QVector2D ellipseRadius, qreal deg, + qreal arcAngle1, qreal arcAngle2, + RoundedCornerIndex index) +{ + // make rounding corner bigger and produces smoother result + const qreal smoothFactor = 1.5; + + deg *= smoothFactor; + + bool done = false; + + const QVector2D ellipseInnerRadius(innerArcRatio * ellipseRadius.x(), + innerArcRatio * ellipseRadius.y()); + + const qreal arcAngle = arc_angle(arcAngle1); + const QVector2D innerArcPoint = + arc_point(center, ellipseInnerRadius, arcAngle); // point on the inner arc + + const qreal angle = arcAngle1 > arcAngle2 ? arcAngle - deg : arcAngle + deg; + + const QVector2D B = arc_point(center, ellipseInnerRadius, angle); // point on arc + + // calculate tangent vector + const QVector2D uV = tangent_ccw(ellipseInnerRadius, angle).normalized(); + const QVector2D b1 = B + uV; + + qreal s = 0, t = 0; + bool res = lines_intersect(center, innerArcPoint, B, b1, &s, &t); + + if (res) { + // hit point + const QVector2D A = center + s * (innerArcPoint - center); // point on edge + + const auto arcPoint = arc_point(center, ellipseRadius, arcAngle); + + const QVector2D AB = B - A; + const QVector2D AC = A - innerArcPoint; + + const qreal a = angle_between_vectors(AB, AC); + const qreal halfAngle = std::fabs(a) * 0.5; + const qreal edgeOffset = AB.length(); + + const qreal corner_radius = edgeOffset * qTan(halfAngle); + + // constrain by sweep + const qreal sweep = std::fabs(arcAngle2 - arcAngle1) * 0.5; + const qreal degMax = std::min(sweep, 45.0); + + const QVector2D C = A + AC.normalized() * edgeOffset; + + const qreal ptoc = (innerArcPoint - C).length(); + const qreal edge = (innerArcPoint - arcPoint).length(); + + const qreal diff = + std::fabs(corner_radius - cornerRadius * smoothFactor); // closest to target radius + + auto &rc = roundedCorners[index]; + + bool canUpdate = diff < rc.diff && !(corner_radius > cornerRadius * smoothFactor) + && !(deg > degMax) && !(rc.radius > corner_radius) && !(ptoc > edge * 0.5f); + + // 1st loop or if constraints are met + if (rc.radius == 0 || canUpdate) + rc.update(diff, A, B, C, a, corner_radius); + + done = + // corner radius is bigger or equal to the target radius + corner_radius > cornerRadius * smoothFactor + || is_equal(corner_radius, cornerRadius * smoothFactor, 0.01f) + // angle used to define point B is bigger than available sweep + || deg > degMax + || is_equal(deg, degMax, 0.01f) + // the corner radius starts to decline (from previously calculated) + || (rc.radius != 0 && rc.radius > corner_radius) + // point C is beyond the half of the ellipse edge + // (closer to the inner arc end point) + || (ptoc > edge * 0.5f); + } + + return done; +} + +void QQuickEllipseShapePrivate::drawCenterCorner() +{ + auto &rc = roundedCorners[RoundedCornerIndex::Center]; + path->setStartX(rc.B.x()); + path->setStartY(rc.B.y()); + + addArc(rc.C, QVector2D(rc.radius, rc.radius), + rc.alpha < 0 ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); +} + +void QQuickEllipseShapePrivate::drawInnerEndCorner() +{ + auto &rc = roundedCorners[RoundedCornerIndex::InnerEnd]; + + addLine(rc.C); + + addArc(rc.B, QVector2D(rc.radius, rc.radius), + rc.alpha > 0 ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); +} + +void QQuickEllipseShapePrivate::drawInnerBeginCorner() +{ + auto &rc = roundedCorners[RoundedCornerIndex::InnerBegin]; + path->setStartX(rc.B.x()); + path->setStartY(rc.B.y()); + + addArc(rc.C, QVector2D(rc.radius, rc.radius), + rc.alpha < 0 ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); +} + +void QQuickEllipseShapePrivate::drawOuterBeginCorner() +{ + auto &rc = roundedCorners[RoundedCornerIndex::OuterBegin]; + + addLine(rc.C); + + addArc(rc.B, QVector2D(rc.radius, rc.radius), + rc.alpha > 0 ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); +} + +void QQuickEllipseShapePrivate::drawOuterArcRounded(QVector2D center, QVector2D ellipseRadius) +{ + // split outer arc in two parts to avoid issues of the large arc + const qreal endAngle = startAngle + sweepAngle; + + const qreal angle = startAngle > endAngle + ? arc_angle(startAngle - std::fabs(sweepAngle * 0.5f)) + : arc_angle(startAngle + std::fabs(sweepAngle * 0.5f)); + const auto point = arc_point(center, ellipseRadius, angle); // mid point of the arc + + // from begin to mid point + addArc(point, ellipseRadius, + sweepAngle > 0.0f ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); + + auto &rc = roundedCorners[RoundedCornerIndex::OuterEnd]; + + // from mid point to end rounded corner + addArc(rc.B, ellipseRadius, + sweepAngle > 0.0f ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); + + // rounded corner + addArc(rc.C, QVector2D(rc.radius, rc.radius), + rc.alpha < 0 ? QQuickPathArc::Clockwise : QQuickPathArc::Counterclockwise); +} + +void QQuickEllipseShapePrivate::drawInnerArcRounded(QVector2D center, QVector2D ellipseRadius) +{ + // split inner arc in two parts to avoid issues of the large arc + const qreal endAngle = startAngle + sweepAngle; + + const QVector2D ellipseInnerRadius(innerArcRatio * ellipseRadius.x(), + innerArcRatio * ellipseRadius.y()); + + const qreal angle = endAngle > startAngle ? arc_angle(endAngle - std::fabs(sweepAngle * 0.5f)) + : arc_angle(endAngle + std::fabs(sweepAngle * 0.5f)); + const auto point = arc_point(center, ellipseInnerRadius, angle); // mid point of the arc + + // from end to mid point + addArc(point, ellipseInnerRadius, + sweepAngle > 0.0f ? QQuickPathArc::Counterclockwise : QQuickPathArc::Clockwise); + + // from mid point to begin rounded corner + auto &rc = roundedCorners[RoundedCornerIndex::InnerBegin]; + addArc(rc.B, ellipseInnerRadius, + sweepAngle > 0.0f ? QQuickPathArc::Counterclockwise : QQuickPathArc::Clockwise); +} + +void QQuickEllipseShapePrivate::drawOuterArc(QVector2D center, QVector2D ellipseRadius) +{ + const qreal beginAngle = arc_angle(startAngle); + const qreal endAngle = arc_angle(startAngle + sweepAngle); + + const qreal alpha = std::clamp(std::fabs(sweepAngle), 0.0, 359.9); + bool isFull = (alpha <= 0.0f || alpha >= 359.0f); + + // QQuickPathArc has some weird behavior when it starts and ends at the same point + // leave some gap between the start and the end points in order to avoid it + const auto beginPoint = arc_point(center, ellipseRadius, isFull ? 0 : beginAngle); + const auto endPoint = arc_point(center, ellipseRadius, isFull ? 359.9 : endAngle); + + path->setStartX(beginPoint.x()); + path->setStartY(beginPoint.y()); + + addArc(endPoint, ellipseRadius, + isFull ? QQuickPathArc::Clockwise + : (sweepAngle > 0.0f ? QQuickPathArc::Clockwise + : QQuickPathArc::Counterclockwise), + isFull ? true : alpha > 180.0f); +} + +void QQuickEllipseShapePrivate::drawFullInnerArc(QVector2D center, QVector2D ellipseRadius) +{ + const qreal beginAngle = arc_angle(startAngle); + + auto arc = new QQuickPathAngleArc(path); + arc->setCenterX(center.x()); + arc->setCenterY(center.y()); + arc->setStartAngle(beginAngle); + arc->setRadiusX(innerArcRatio * ellipseRadius.x()); + arc->setRadiusY(innerArcRatio * ellipseRadius.y()); + arc->setSweepAngle(sweepAngle); + QQuickPathPrivate::get(path)->appendPathElement(arc); +} + +void QQuickEllipseShapePrivate::drawWithInnerRadius(QVector2D center, QVector2D ellipseRadius) +{ + drawInnerBeginCorner(); // path starts at the begin rounded corner on the inner arc + + drawOuterBeginCorner(); // path continues to the begin rounded corner on the outer arc + + // outer arc connecting begin and end rounded corners + drawOuterArcRounded(center, ellipseRadius); + + // path continues to the end rounded corner on the inner arc + drawInnerEndCorner(); + + // inner arc connecting end and begin rounded corners + drawInnerArcRounded(center, ellipseRadius); +} + +void QQuickEllipseShapePrivate::drawWithoutInnerRadius(QVector2D center, QVector2D ellipseRadius) +{ + drawCenterCorner(); // path starts at rounded corner of ellipse center + + drawOuterBeginCorner(); // path continues to the begin rounded corner on the outer arc + + // outer arc connecting begin and end rounded corners + drawOuterArcRounded(center, ellipseRadius); + + // path ends at the ellipse's center rounded corner + const auto &rc = roundedCorners[RoundedCornerIndex::Center]; + addLine(rc.B); +} + +void QQuickEllipseShapePrivate::updatePath() +{ + const qreal borderOffset = getBorderOffset(); + const QVector2D center = + QVector2D(width.valueBypassingBindings(), height.valueBypassingBindings()) * 0.5f; + const QVector2D ellipseRadius = center - QVector2D(borderOffset, borderOffset); + + QQuickPathPrivate::get(path)->clearPathElements(QQuickPathPrivate::DeleteElementPolicy::Delete); + + const qreal alpha = std::clamp(std::fabs(sweepAngle), 0.0, 359.9); + const bool isFull = alpha >= 359.0; + + if (qFuzzyCompare(alpha, 0)) + return; + + // just an arc + if (qFuzzyCompare(innerArcRatio, 1) || (hideLine && qFuzzyCompare(innerArcRatio, 0))) { + drawOuterArc(center, ellipseRadius); + return; + } + + roundedCorners.reset(); // cleanup old results + + if (innerArcRatio != 0 && isFull) { + // this is a donut + drawOuterArc(center, ellipseRadius); + drawFullInnerArc(center, ellipseRadius); + } else if (innerArcRatio != 0 && !isFull) { + // this is an outlined arc + roundBeginEnd(center, ellipseRadius); + drawWithInnerRadius(center, ellipseRadius); + } else if (!isFull) { + // this is a pie + roundCenter(center, ellipseRadius); + roundBeginEnd(center, ellipseRadius); + drawWithoutInnerRadius(center, ellipseRadius); + } else { + drawOuterArc(center, ellipseRadius); + } +} + +/*! + \qmltype EllipseShape + \inqmlmodule QtQuick.Shapes.DesignHelpers + \brief A shape component that can render an ellipse, an arc, or a pie slice. + \since QtQuick 6.10 + + The EllipseShape item paints an ellipse, which can be customized to appear + as a full ellipse, an arc, or a filled pie slice. Its appearance is + controlled by the \l startAngle and \l sweepAngle properties. + + \section1 Basic Ellipse + By default, the item renders a full ellipse. The interior is filled with the + \l fillColor, and the outline is drawn according to the \l strokeColor, \l + strokeWidth, and \l strokeStyle properties. + + \section1 Arc and Pie Slices + To create an arc or a pie slice, set the \l startAngle (0-360 degrees) and + \l sweepAngle (0-360 degrees) to define the segment of the ellipse to draw. + + \b {Arc Mode}: To create a simple arc (just the outline), set the \l + fillColor to \c "transparent". The arc's line style can be customized with + \l dashPattern and \l dashOffset. + + \b {Pie Mode}: To create a filled pie slice (a segment connected to the + center), simply set the \l fillColor. The outline of the slice will also be + stroked. + + \b {Donut Mode}: To create a donut ring (a hollow ellipse), set the + \l innerArcRatio to a value between 0.0 and 1.0. This defines the ratio of + the inner ellipse's radius to the outer ellipse's radius. + + The area inside the stroke is painted using either a solid fill color, + specified using the \l fillColor property, or a gradient, defined using one + of the \l ShapeGradient subtypes and set using the \l fillGradient + property. If both a color and a gradient are specified, the gradient is + used. + + An optional border can be added to an ellipse with its own color and + thickness by setting the \l strokeColor and \l strokeWidth properties. + Setting the color to \c transparent creates a border without a fill color. + + Ellipse can be drawn with rounded corners using the \l cornerRadius + property. The default value of the \l cornerRadius is 10 degrees. + + EllipseShape's default value for \l preferredRendererType is + \c Shape.CurveRenderer. + + \section1 Example Usage + + \snippet ellipseshape.qml ellipseShape + + \image path-ellipseshape.png +*/ +QQuickEllipseShape::QQuickEllipseShape(QQuickItem *parent) + : QQuickShape(*(new QQuickEllipseShapePrivate), parent) +{ + Q_D(QQuickEllipseShape); + + setPreferredRendererType(CurveRenderer); + + setWidth(100); + setHeight(100); + + d->path = new QQuickShapePath(this); + d->path->setParent(this); + d->path->setAsynchronous(true); + d->path->setStrokeWidth(4); + d->path->setStrokeColor(QColorConstants::Black); + + d->sp.append(d->path); + d->path->setParent(this); + d->extra.value().resourcesList.append(d->path); +} + +QQuickEllipseShape::~QQuickEllipseShape() = default; + +bool QQuickEllipseShape::hideLine() const +{ + Q_D(const QQuickEllipseShape); + return d->hideLine; +} + +void QQuickEllipseShape::setHideLine(bool hideLine) +{ + Q_D(QQuickEllipseShape); + if (d->hideLine == hideLine) + return; + d->hideLine = hideLine; + d->updatePath(); + emit hideLineChanged(); +} + +/*! + \qmlproperty real QtQuick.Shapes.DesignHelpers::EllipseShape::sweepAngle + + The angular extent in degrees to be drawn from the \l startAngle. + + If set to positive value, the arc is drawn in clockwise direction. + If set to negative value, the arc is drawn in counter-clockwise direction. + + The default value is \c 360. +*/ +qreal QQuickEllipseShape::sweepAngle() const +{ + Q_D(const QQuickEllipseShape); + return d->sweepAngle; +} + +void QQuickEllipseShape::setSweepAngle(qreal sweepAngle) +{ + Q_D(QQuickEllipseShape); + if (qFuzzyCompare(d->sweepAngle, sweepAngle)) + return; + d->sweepAngle = sweepAngle; + d->updatePath(); + emit sweepAngleChanged(); +} + +/*! + \qmlproperty real QtQuick.Shapes.DesignHelpers::EllipseShape::startAngle + + The property defines the starting angle in degrees from which to begin + drawing the ellipse. + + 0 degrees points to the top. Angle increases in clockwise direction. + + The default value is \c 0. +*/ +qreal QQuickEllipseShape::startAngle() const +{ + Q_D(const QQuickEllipseShape); + return d->startAngle; +} + +void QQuickEllipseShape::setStartAngle(qreal startAngle) +{ + Q_D(QQuickEllipseShape); + if (qFuzzyCompare(d->startAngle, startAngle)) + return; + d->startAngle = startAngle; + d->updatePath(); + emit startAngleChanged(); +} + +/*! + \include shapepath.qdocinc {dashOffset-property} {QtQuick.Shapes.DesignHelpers::EllipseShape} +*/ + +qreal QQuickEllipseShape::dashOffset() const +{ + Q_D(const QQuickEllipseShape); + return d->path->dashOffset(); +} + +void QQuickEllipseShape::setDashOffset(qreal offset) +{ + Q_D(QQuickEllipseShape); + if (qFuzzyCompare(d->path->dashOffset(), offset)) + return; + d->path->setDashOffset(offset); + d->updatePath(); + emit dashOffsetChanged(); +} + +/*! + \qmlproperty real QtQuick.Shapes.DesignHelpers::EllipseShape::cornerRadius + + Controls the rounding of corners where the radial lines meet the elliptical + arcs. For pie segments, this rounds the connection to the outer arc. For + donut segments, this also rounds the connections to both inner and outer arcs. + + The default value is \c 10. +*/ +qreal QQuickEllipseShape::cornerRadius() const +{ + Q_D(const QQuickEllipseShape); + return d->cornerRadius; +} + +void QQuickEllipseShape::setCornerRadius(qreal cornerRadius) +{ + Q_D(QQuickEllipseShape); + if (qFuzzyCompare(d->cornerRadius, cornerRadius)) + return; + d->cornerRadius = cornerRadius; + d->updatePath(); + emit cornerRadiusChanged(); +} + +/*! + \qmlproperty real QtQuick.Shapes.DesignHelpers::EllipseShape::innerArcRatio + + This property defines the ratio between the inner and outer arcs. + + Value range is between 0.0 and 1.0. Setting the value to 0.0 will cause + the inner arc to collapse toward the center, drawing a solid filled + ellipse. Setting the value to 1.0 makes the inner arc the same size as the + outer ellipse, resulting in just an arc. Values between 0.0 and 1.0 create + hollow elliptical rings. + + The default value is \c 0. +*/ +qreal QQuickEllipseShape::innerArcRatio() const +{ + Q_D(const QQuickEllipseShape); + return d->innerArcRatio; +} + +void QQuickEllipseShape::setInnerArcRatio(qreal innerArcRatio) +{ + Q_D(QQuickEllipseShape); + if (qFuzzyCompare(d->innerArcRatio, innerArcRatio)) + return; + d->innerArcRatio = innerArcRatio; + d->updatePath(); + emit innerArcRatioChanged(); +} + +/*! + \qmlproperty real QtQuick.Shapes.DesignHelpers::EllipseShape::strokeWidth + + This property holds the stroke width. + + When set to a negative value, no stroking occurs. + + The default value is \c 1. +*/ + +qreal QQuickEllipseShape::strokeWidth() const +{ + Q_D(const QQuickEllipseShape); + return d->path->strokeWidth(); +} + +void QQuickEllipseShape::setStrokeWidth(qreal width) +{ + Q_D(QQuickEllipseShape); + if (qFuzzyCompare(d->path->strokeWidth(), width)) + return; + d->path->setStrokeWidth(width); + d->updatePath(); + emit strokeWidthChanged(); +} + +/*! + \qmlproperty color QtQuick.Shapes.DesignHelpers::EllipseShape::fillColor + + This property holds the fill color. + + When set to \c transparent, no filling occurs. + + The default value is \c "white". + + \note If either \l fillGradient is set to something other than \c null, it + will be used instead of \c fillColor. +*/ + +QColor QQuickEllipseShape::fillColor() const +{ + Q_D(const QQuickEllipseShape); + return d->path->fillColor(); +} + +void QQuickEllipseShape::setFillColor(const QColor &color) +{ + Q_D(QQuickEllipseShape); + d->path->setFillColor(color); + d->updatePath(); + emit fillColorChanged(); +} + +/*! + \qmlproperty color QtQuick.Shapes.DesignHelpers::EllipseShape::strokeColor + + This property holds the stroking color. + + When set to \c transparent, no stroking occurs. + + The default value is \c "black". +*/ + +QColor QQuickEllipseShape::strokeColor() const +{ + Q_D(const QQuickEllipseShape); + return d->path->strokeColor(); +} + +void QQuickEllipseShape::setStrokeColor(const QColor &color) +{ + Q_D(QQuickEllipseShape); + d->path->setStrokeColor(color); + d->updatePath(); + emit strokeColorChanged(); +} + +/*! + \include shapepath.qdocinc {capStyle-property} {QtQuick.Shapes.DesignHelpers::EllipseShape} +*/ + +QQuickShapePath::CapStyle QQuickEllipseShape::capStyle() const +{ + Q_D(const QQuickEllipseShape); + return d->path->capStyle(); +} + +void QQuickEllipseShape::setCapStyle(QQuickShapePath::CapStyle style) +{ + Q_D(QQuickEllipseShape); + if (d->path->capStyle() == style) + return; + d->path->setCapStyle(style); + d->updatePath(); + emit capStyleChanged(); +} + +/*! + \include shapepath.qdocinc {joinStyle-property} {QtQuick.Shapes.DesignHelpers::EllipseShape} +*/ + +QQuickShapePath::JoinStyle QQuickEllipseShape::joinStyle() const +{ + Q_D(const QQuickEllipseShape); + return d->path->joinStyle(); +} + +void QQuickEllipseShape::setJoinStyle(QQuickShapePath::JoinStyle style) +{ + Q_D(QQuickEllipseShape); + if (d->path->joinStyle() == style) + return; + d->path->setJoinStyle(style); + d->updatePath(); + emit joinStyleChanged(); +} + +/*! + \include shapepath.qdocinc {strokeStyle-property} {QtQuick.Shapes.DesignHelpers::EllipseShape} +*/ + +QQuickShapePath::StrokeStyle QQuickEllipseShape::strokeStyle() const +{ + Q_D(const QQuickEllipseShape); + return d->path->strokeStyle(); +} + +void QQuickEllipseShape::setStrokeStyle(QQuickShapePath::StrokeStyle style) +{ + Q_D(QQuickEllipseShape); + if (d->path->strokeStyle() == style) + return; + d->path->setStrokeStyle(style); + d->updatePath(); + emit strokeStyleChanged(); +} + +/*! + \include shapepath.qdocinc {fillRule-property} {QtQuick.Shapes.DesignHelpers::EllipseShape} +*/ + +QQuickShapePath::FillRule QQuickEllipseShape::fillRule() const +{ + Q_D(const QQuickEllipseShape); + return d->path->fillRule(); +} + +void QQuickEllipseShape::setFillRule(QQuickShapePath::FillRule fillRule) +{ + Q_D(QQuickEllipseShape); + if (d->path->fillRule() == fillRule) + return; + d->path->setFillRule(fillRule); + d->updatePath(); + emit fillRuleChanged(); +} + +/*! + \include shapepath.qdocinc {dashPattern-property} {QtQuick.Shapes.DesignHelpers::EllipseShape} +*/ + +QVector<qreal> QQuickEllipseShape::dashPattern() const +{ + Q_D(const QQuickEllipseShape); + return d->path->dashPattern(); +} + +void QQuickEllipseShape::setDashPattern(const QVector<qreal> &array) +{ + Q_D(QQuickEllipseShape); + d->path->setDashPattern(array); + d->updatePath(); + emit dashPatternChanged(); +} + +/*! + \qmlproperty ShapeGradient QtQuick.Shapes.DesignHelpers::EllipseShape::fillGradient + + The fillGradient of the ellipse fill color. + + By default, no fillGradient is enabled and the value is null. In this case, the + fill uses a solid color based on the value of \l fillColor. + + When set, \l fillColor is ignored and filling is done using one of the + \l ShapeGradient subtypes. + + \note The \l Gradient type cannot be used here. Rather, prefer using one of + the advanced subtypes, like \l LinearGradient. +*/ +QQuickShapeGradient *QQuickEllipseShape::fillGradient() const +{ + Q_D(const QQuickEllipseShape); + return d->path->fillGradient(); +} + +void QQuickEllipseShape::setFillGradient(QQuickShapeGradient *fillGradient) +{ + Q_D(QQuickEllipseShape); + d->path->setFillGradient(fillGradient); + d->updatePath(); + emit gradientChanged(); +} + +void QQuickEllipseShape::resetFillGradient() +{ + setFillGradient(nullptr); +} + +/*! + \qmlproperty enumeration QtQuick.Shapes.DesignHelpers::EllipseShape::borderMode + + The \l borderMode property determines where the border is drawn along the + edge of the ellipse. + + \value EllipseShape.Inside + The border is drawn along the inside edge of the item and does not + affect the item width. + + This is the default value. + \value EllipseShape.Middle + The border is drawn over the edge of the item and does not + affect the item width. + \value EllipseShape.Outside + The border is drawn along the outside edge of the item and increases + the item width by the value of \l strokeWidth. + + \sa strokeWidth +*/ +QQuickEllipseShape::BorderMode QQuickEllipseShape::borderMode() const +{ + Q_D(const QQuickEllipseShape); + return d->borderMode; +} + +void QQuickEllipseShape::setBorderMode(BorderMode borderMode) +{ + Q_D(QQuickEllipseShape); + if (borderMode == d->borderMode) + return; + d->borderMode = borderMode; + d->updatePath(); + emit borderModeChanged(); +} + +void QQuickEllipseShape::resetBorderMode() +{ + setBorderMode(BorderMode::Inside); +} + +void QQuickEllipseShape::itemChange(ItemChange change, const ItemChangeData &value) +{ + Q_D(QQuickEllipseShape); + + if (d->path) + d->updatePath(); + + QQuickItem::itemChange(change, value); +} + +QT_END_NAMESPACE + +#include "moc_qquickellipseshape_p.cpp" diff --git a/src/quickshapes/designhelpers/qquickellipseshape_p.h b/src/quickshapes/designhelpers/qquickellipseshape_p.h new file mode 100644 index 0000000000..0e11a79cb7 --- /dev/null +++ b/src/quickshapes/designhelpers/qquickellipseshape_p.h @@ -0,0 +1,144 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QQUICKELLIPSESHAPE_P_H +#define QQUICKELLIPSESHAPE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QtQuickShapes/private/qquickshape_p.h> +#include <QtQuickShapesDesignHelpers/qtquickshapesdesignhelpersexports.h> + +QT_BEGIN_NAMESPACE + +class QQuickEllipseShapePrivate; + +class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickEllipseShape : public QQuickShape +{ +public: + Q_OBJECT + Q_PROPERTY(qreal sweepAngle READ sweepAngle WRITE setSweepAngle NOTIFY sweepAngleChanged FINAL) + Q_PROPERTY(qreal startAngle READ startAngle WRITE setStartAngle NOTIFY startAngleChanged FINAL) + Q_PROPERTY(qreal dashOffset READ dashOffset WRITE setDashOffset NOTIFY dashOffsetChanged FINAL) + Q_PROPERTY(qreal innerArcRatio READ innerArcRatio WRITE setInnerArcRatio NOTIFY + innerArcRatioChanged FINAL) + Q_PROPERTY(qreal cornerRadius READ cornerRadius WRITE setCornerRadius NOTIFY cornerRadiusChanged + FINAL) + Q_PROPERTY( + qreal strokeWidth READ strokeWidth WRITE setStrokeWidth NOTIFY strokeWidthChanged FINAL) + Q_PROPERTY(bool hideLine READ hideLine WRITE setHideLine NOTIFY hideLineChanged FINAL) + Q_PROPERTY(QColor fillColor READ fillColor WRITE setFillColor NOTIFY fillColorChanged FINAL) + Q_PROPERTY(QColor strokeColor READ strokeColor WRITE setStrokeColor NOTIFY strokeColorChanged + FINAL) + Q_PROPERTY(QQuickShapePath::CapStyle capStyle READ capStyle WRITE setCapStyle NOTIFY + capStyleChanged FINAL) + Q_PROPERTY(QQuickShapePath::JoinStyle joinStyle READ joinStyle WRITE setJoinStyle NOTIFY + joinStyleChanged FINAL) + Q_PROPERTY(QQuickShapePath::StrokeStyle strokeStyle READ strokeStyle WRITE setStrokeStyle NOTIFY + strokeStyleChanged FINAL) + Q_PROPERTY(QQuickShapePath::FillRule fillRule READ fillRule WRITE setFillRule NOTIFY + fillRuleChanged FINAL) + Q_PROPERTY(QVector<qreal> dashPattern READ dashPattern WRITE setDashPattern NOTIFY + dashPatternChanged FINAL) + Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient NOTIFY + gradientChanged RESET resetFillGradient FINAL) + Q_PROPERTY(BorderMode borderMode READ borderMode WRITE setBorderMode NOTIFY borderModeChanged + RESET resetBorderMode FINAL) + + QML_NAMED_ELEMENT(EllipseShape) + QML_ADDED_IN_VERSION(6, 10) + +public: + QQuickEllipseShape(QQuickItem *parent = nullptr); + ~QQuickEllipseShape() override; + + qreal sweepAngle() const; + void setSweepAngle(qreal sweepAngle); + + qreal startAngle() const; + void setStartAngle(qreal startAngle); + + qreal dashOffset() const; + void setDashOffset(qreal offset); + + qreal innerArcRatio() const; + void setInnerArcRatio(qreal innerArcRatio); + + qreal cornerRadius() const; + void setCornerRadius(qreal cornerRadius); + + qreal strokeWidth() const; + void setStrokeWidth(qreal width); + + bool hideLine() const; + void setHideLine(bool hideLine); + + QColor fillColor() const; + void setFillColor(const QColor &color); + + QColor strokeColor() const; + void setStrokeColor(const QColor &color); + + QQuickShapePath::CapStyle capStyle() const; + void setCapStyle(QQuickShapePath::CapStyle style); + + QQuickShapePath::JoinStyle joinStyle() const; + void setJoinStyle(QQuickShapePath::JoinStyle style); + + QQuickShapePath::StrokeStyle strokeStyle() const; + void setStrokeStyle(QQuickShapePath::StrokeStyle style); + + QQuickShapePath::FillRule fillRule() const; + void setFillRule(QQuickShapePath::FillRule fillRule); + + QVector<qreal> dashPattern() const; + void setDashPattern(const QVector<qreal> &array); + + QQuickShapeGradient *fillGradient() const; + void setFillGradient(QQuickShapeGradient *fillGradient); + void resetFillGradient(); + + enum class BorderMode { Inside, Middle, Outside }; + Q_ENUM(BorderMode) + BorderMode borderMode() const; + void setBorderMode(BorderMode borderMode); + void resetBorderMode(); + +Q_SIGNALS: + void innerArcRatioChanged(); + void cornerRadiusChanged(); + void hideLineChanged(); + void startAngleChanged(); + void sweepAngleChanged(); + void strokeColorChanged(); + void strokeWidthChanged(); + void fillColorChanged(); + void joinStyleChanged(); + void capStyleChanged(); + void fillRuleChanged(); + void strokeStyleChanged(); + void dashOffsetChanged(); + void dashPatternChanged(); + void gradientChanged(); + void borderModeChanged(); + +protected: + void itemChange(ItemChange change, const ItemChangeData &value) override; + +private: + Q_DISABLE_COPY(QQuickEllipseShape) + Q_DECLARE_PRIVATE(QQuickEllipseShape) +}; + +QT_END_NAMESPACE + +#endif // QQUICKELLIPSE1SHAPE_P_H diff --git a/src/quickshapes/designhelpers/qquickellipseshape_p_p.h b/src/quickshapes/designhelpers/qquickellipseshape_p_p.h new file mode 100644 index 0000000000..f9a9b8bbc9 --- /dev/null +++ b/src/quickshapes/designhelpers/qquickellipseshape_p_p.h @@ -0,0 +1,149 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QQUICKELLIPSESHAPE_P_P_H +#define QQUICKELLIPSESHAPE_P_P_H + +#include "qquickellipseshape_p.h" +#include <QtQml/private/qqmlpropertyutils_p.h> +#include <QtQuickShapes/private/qquickshape_p_p.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +class Q_QUICKSHAPESDESIGNHELPERS_EXPORT QQuickEllipseShapePrivate : public QQuickShapePrivate +{ + Q_DECLARE_PUBLIC(QQuickEllipseShape) + +public: + QQuickEllipseShapePrivate(); + ~QQuickEllipseShapePrivate() override; + + struct RoundedCorner + { + void update(qreal diff, QVector2D a, QVector2D b, QVector2D c, qreal alpha, qreal radius) + { + A = a; + B = b; + C = c; + this->alpha = alpha; + this->radius = radius; + this->diff = diff; + } + + void reset() + { + A = QVector2D(); + B = QVector2D(); + C = QVector2D(); + alpha = 0; + radius = 0; + diff = 0; + } + + // A - a point, where the rounding corner is located + QVector2D A; + // B - tangent point of the rounded corner arc, which is located on the ellipse's arc + // for the rounded corner at the ellipse's center this is a point on the edge defined by the + // end angle + // for the rounded corner at the begin angle this is a point on the outer arc of the ellipse + QVector2D B; + // C - tangent point of the rounded corner arc, which is located on the ellipse's edge + // for the rounded corner at the ellipse's center this is a point on the edge defined by the + // begin angle + QVector2D C; + qreal alpha = 0; // angle between AB and AC + qreal radius = 0; // rounded corner radius + // not a rounded corner data, but a helper used to compare + // currently calculated radius to the previously calculated radius + qreal diff = 0; + }; + + enum class RoundedCornerIndex { Center, InnerEnd, OuterEnd, InnerBegin, OuterBegin }; + + // helper, to avoid typing static_cast<int>(RoundedCornerIndex) every time + class RoundedCornerArray + { + public: + RoundedCorner &operator[](RoundedCornerIndex index) + { + return array[static_cast<int>(index)]; + } + + void reset() + { + for (auto &rc : array) + rc.reset(); + } + + private: + RoundedCorner array[5]; + } roundedCorners; + + void addLine(QVector2D point); + void addArc(QVector2D point, QVector2D arcRadius, QQuickPathArc::ArcDirection dir, + bool largeArc = false); + + qreal getBorderOffset() const; + + // calculates rounded corner at the ellipse center + void roundCenter(QVector2D center, QVector2D ellipseRadius); + // runs loop where begin and end rounded corners are calculated + void roundBeginEnd(QVector2D center, QVector2D ellipseRadius); + // calculates rounded corners on the outer arc + bool roundOuter(QVector2D center, QVector2D ellipseRadius, qreal deg, qreal arcAngle1, + qreal arcAngle2, RoundedCornerIndex index); + // calculates rounded corners on the inner arc + bool roundInner(QVector2D center, QVector2D ellipseRadius, qreal deg, qreal arcAngle1, + qreal arcAngle2, RoundedCornerIndex index); + + // starts path at the center rounded corner and draws center rounded corner + void drawCenterCorner(); + // connects outer and inner arcs with line and draws end rounded corner + void drawInnerEndCorner(); + // starts path at the begin rounded corner and draws begin rounded corner + void drawInnerBeginCorner(); + // connects previous rounded corner (center or begin) with line and draws begin rounded corner + void drawOuterBeginCorner(); + + // draw outer arc path from begin rounded corner to the end rounded corner + void drawOuterArcRounded(QVector2D center, QVector2D ellipseRadius); + // draw inner arc path from end rounded corner to the begin rounded corner + void drawInnerArcRounded(QVector2D center, QVector2D ellipseRadius); + + // draws outer arc when no rounded corners involved + void drawOuterArc(QVector2D center, QVector2D ellipseRadius); + // draws full inner arc (no rounded corners) + void drawFullInnerArc(QVector2D center, QVector2D ellipseRadius); + + // draws an ellipse when inner radius is not zero + void drawWithInnerRadius(QVector2D center, QVector2D ellipseRadius); + // draws an ellipse when inner radius is greater than zero + void drawWithoutInnerRadius(QVector2D center, QVector2D ellipseRadius); + + void updatePath(); + + QQuickShapePath *path = nullptr; + + bool hideLine = false; + + qreal startAngle = 0; + qreal sweepAngle = 360; + qreal innerArcRatio = 0; + qreal cornerRadius = 10; + QQuickEllipseShape::BorderMode borderMode = QQuickEllipseShape::BorderMode::Inside; +}; + +QT_END_NAMESPACE + +#endif // QQUICKELLIPSE1SHAPE_P_P_H diff --git a/tests/auto/qml/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp b/tests/auto/qml/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp index 471f3df39e..1fd5629f90 100644 --- a/tests/auto/qml/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp +++ b/tests/auto/qml/animation/qabstractanimationjob/tst_qabstractanimationjob.cpp @@ -1,10 +1,12 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include <QtQml/qqmlengine.h> +#include <QtTest/qtest.h> -#include <QtQml/private/qabstractanimationjob_p.h> -#include <QtQml/private/qanimationgroupjob_p.h> -#include <QTest> +#include <private/qabstractanimationjob_p.h> +#include <private/qanimationgroupjob_p.h> +#include <private/qcoreapplication_p.h> class tst_QAbstractAnimationJob : public QObject { @@ -23,6 +25,7 @@ private slots: void avoidJumpAtStart(); void avoidJumpAtStartWithStop(); void avoidJumpAtStartWithRunning(); + void deleteAnimationTimer(); }; class TestableQAbstractAnimation : public QAbstractAnimationJob @@ -184,6 +187,24 @@ void tst_QAbstractAnimationJob::avoidJumpAtStartWithRunning() QVERIFY(anim3.currentTime() < 50); } +void tst_QAbstractAnimationJob::deleteAnimationTimer() +{ + for (int i = 0; i < 10; ++i) { + { + TestableQAbstractAnimation mainAnimation; + mainAnimation.setDuration(100); + mainAnimation.start(); + QTRY_VERIFY(mainAnimation.isRunning()); + QTRY_VERIFY(mainAnimation.currentTime() > 50); + } + + // We can tear down the thread data that holds the animation timer. This does not cause + // the QUnifiedTimer to hold a dangling pointer next timer around. + static_cast<QCoreApplicationPrivate *>(QObjectPrivate::get(QCoreApplication::instance())) + ->cleanupThreadData(); + } +} + QTEST_MAIN(tst_QAbstractAnimationJob) diff --git a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt index efd95ce64f..29b272c440 100644 --- a/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt +++ b/tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt @@ -151,6 +151,7 @@ set(qml_files detachedreferences.qml dialog.qml dialogButtonBox.qml + disappearingArrowFunction.qml dynamicscene.qml enforceSignature.qml enumConversion.qml diff --git a/tests/auto/qml/qmlcppcodegen/data/disappearingArrowFunction.qml b/tests/auto/qml/qmlcppcodegen/data/disappearingArrowFunction.qml new file mode 100644 index 0000000000..cb97ab5c02 --- /dev/null +++ b/tests/auto/qml/qmlcppcodegen/data/disappearingArrowFunction.qml @@ -0,0 +1,28 @@ +pragma Strict +import QtQml + +QtObject { + property Person inner: Person { + function getName() : int { return 5 } + } + + property Person none: Person {} + + property Person evil: Person { + property string getName: "not a function" + } + + onObjectNameChanged: console.log(inner.getName()) + + function swapNone() { + let t = inner; + inner = none; + none = t; + } + + function swapEvil() { + let t = inner; + inner = evil; + evil = t; + } +} diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index 579f279e93..5780862b47 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -103,6 +103,7 @@ private slots: void detachOnAssignment(); void detachedReferences(); void dialogButtonBox(); + void disappearingArrowFunction(); void enumConversion(); void enumFromBadSingleton(); void enumLookup(); @@ -1866,6 +1867,56 @@ void tst_QmlCppCodegen::dialogButtonBox() QPlatformDialogHelper::Ok | QPlatformDialogHelper::Cancel); } +void tst_QmlCppCodegen::disappearingArrowFunction() +{ + QQmlEngine engine; + const QUrl url(u"qrc:/qt/qml/TestTypes/disappearingArrowFunction.qml"_s); + QQmlComponent c(&engine, url); + QVERIFY2(c.isReady(), qPrintable(c.errorString())); + QScopedPointer<QObject> o(c.create()); + QVERIFY(!o.isNull()); + + QTest::ignoreMessage(QtDebugMsg, "5"); + o->setObjectName("no"); + + QMetaObject::invokeMethod(o.data(), "swapNone"); + QTest::ignoreMessage(QtDebugMsg, "Bart"); + o->setObjectName("nono"); + + QMetaObject::invokeMethod(o.data(), "swapNone"); + QTest::ignoreMessage(QtDebugMsg, "5"); + o->setObjectName("nonono"); + + const QRegularExpression warning( + QRegularExpression::escape(url.toString()) + + u"\\:15\\: TypeError\\: Property 'getName' of object " + "Person_QML_[0-9]+\\(0x[0-9a-f]+\\) is not a function"_s); + + QMetaObject::invokeMethod(o.data(), "swapEvil"); + QTest::ignoreMessage(QtWarningMsg, warning); + o->setObjectName("nononono"); + + QMetaObject::invokeMethod(o.data(), "swapEvil"); + QTest::ignoreMessage(QtDebugMsg, "5"); + o->setObjectName("nonononono"); + + QMetaObject::invokeMethod(o.data(), "swapNone"); + QTest::ignoreMessage(QtDebugMsg, "Bart"); + o->setObjectName("nononononono"); + + QMetaObject::invokeMethod(o.data(), "swapEvil"); + QTest::ignoreMessage(QtWarningMsg, warning); + o->setObjectName("nonononononono"); + + QMetaObject::invokeMethod(o.data(), "swapEvil"); + QTest::ignoreMessage(QtDebugMsg, "Bart"); + o->setObjectName("nononononononono"); + + QMetaObject::invokeMethod(o.data(), "swapNone"); + QTest::ignoreMessage(QtDebugMsg, "5"); + o->setObjectName("nonononononononono"); +} + void tst_QmlCppCodegen::enumConversion() { QQmlEngine engine; diff --git a/tests/auto/qmlls/qqmlcodemodel/tst_qmlls_qqmlcodemodel.cpp b/tests/auto/qmlls/qqmlcodemodel/tst_qmlls_qqmlcodemodel.cpp index 91e7cdc67f..8e77986ba9 100644 --- a/tests/auto/qmlls/qqmlcodemodel/tst_qmlls_qqmlcodemodel.cpp +++ b/tests/auto/qmlls/qqmlcodemodel/tst_qmlls_qqmlcodemodel.cpp @@ -61,20 +61,25 @@ void tst_qmlls_qqmlcodemodel::buildPathsForFileUrl() QFETCH(QString, expectedPath); QQmlToolingSharedSettings settings(u"qmlls"_s); - if (!pathFromIniFile.isEmpty()) - settings.addOption("buildDir", pathFromIniFile); + QTemporaryDir temporaryDirectory; + QVERIFY(temporaryDirectory.isValid()); + { + QFile settingsFile(temporaryDirectory.filePath(".qmlls.ini")); + QVERIFY(settingsFile.open(QFile::WriteOnly | QFile::Text)); + settingsFile.write("[General]\n"); + if (!pathFromIniFile.isEmpty()) + settingsFile.write("buildDir=\"%1\""_L1.arg(pathFromIniFile).toUtf8()); + } TestCodeModelManager model(&settings); - model.addRootUrls({ QUrl::fromLocalFile(u"./___thispathdoesnotexist123___/"_s).toEncoded() }); + model.addRootUrls({ QUrl::fromLocalFile(temporaryDirectory.path()).toEncoded() }); if (!pathFromCommandLine.isEmpty()) model.setBuildPathsForRootUrl(QByteArray(), QStringList{ pathFromCommandLine }); - // use nonexistent path to avoid loading random .qmlls.ini files that might be laying around. - // in this case, it should abort the search and the standard value we set in the settings const QByteArray nonExistentUrl = - QUrl::fromLocalFile(u"./___thispathdoesnotexist123___/abcdefghijklmnop"_s).toEncoded(); + QUrl::fromLocalFile(temporaryDirectory.filePath(u"file.qml"_s)).toEncoded(); QStringList result = model.buildPathsForFileUrl(nonExistentUrl); QCOMPARE(result.size(), 1); diff --git a/tests/auto/quick/qquicktableview/data/delegateModelAccess.qml b/tests/auto/quick/qquicktableview/data/delegateModelAccess.qml index 21e67bb5d3..5652d986ee 100644 --- a/tests/auto/quick/qquicktableview/data/delegateModelAccess.qml +++ b/tests/auto/quick/qquicktableview/data/delegateModelAccess.qml @@ -68,6 +68,19 @@ Item { property int y: 12 } + function aAt0() : real { + switch (modelIndex) { + case Model.Singular: + case Model.List: + return model.get(0).a + case Model.Array: + return model[0].a + case Model.Object: + return model.a + } + return -1; + } + property int modelIndex: Model.None property int delegateIndex: Delegate.None diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 6205b92acf..b80aaba10c 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -8355,6 +8355,8 @@ void tst_QQuickTableView::delegateModelAccess() const QUrl url = testFileUrl("delegateModelAccess.qml"); LOAD_TABLEVIEW("delegateModelAccess.qml"); + QSignalSpy modelChangedSpy(tableView, &QQuickTableView::modelChanged); + if (delegateKind == Delegate::Untyped && modelKind == Model::Array) QSKIP("Properties of objects in arrays are not exposed as context properties"); @@ -8382,20 +8384,50 @@ void tst_QQuickTableView::delegateModelAccess() ? access != QQmlDelegateModel::ReadOnly : access == QQmlDelegateModel::ReadWrite; + const bool writeShouldPropagate = + + // If we've explicitly asked for the model to be written, it is + (access == QQmlDelegateModel::ReadWrite) || + + // If it's a QAIM or an object, it's implicitly written + (modelKind != Model::Kind::Array) || + + // When writing through the model object from a typed delegate, + // (like with DelegateModel). + (access == QQmlDelegateModel::Qt5ReadWrite && delegateKind == Delegate::Typed); + + // Only the array is actually updated itself. The other models are pointers + const bool writeShouldSignal = modelKind == Model::Kind::Array; + double expected = 11; + // Initial setting of the model, signals one update + int expectedModelUpdates = 1; + QCOMPARE(modelChangedSpy.count(), expectedModelUpdates); + QCOMPARE(delegate->property("immediateX").toDouble(), expected); QCOMPARE(delegate->property("modelX").toDouble(), expected); - if (modelWritable) + if (modelWritable) { expected = 3; + if (writeShouldSignal) + ++expectedModelUpdates; + } QMetaObject::invokeMethod(delegate, "writeThroughModel"); QCOMPARE(delegate->property("immediateX").toDouble(), expected); QCOMPARE(delegate->property("modelX").toDouble(), expected); + QCOMPARE(modelChangedSpy.count(), expectedModelUpdates); + + double aAt0 = -1; + QMetaObject::invokeMethod(tableView, "aAt0", Q_RETURN_ARG(double, aAt0)); + QCOMPARE(aAt0, writeShouldPropagate ? expected : 11); - if (immediateWritable) + if (immediateWritable) { expected = 1; + if (writeShouldSignal) + ++expectedModelUpdates; + } QMetaObject::invokeMethod(delegate, "writeImmediate"); @@ -8404,6 +8436,11 @@ void tst_QQuickTableView::delegateModelAccess() delegateKind == Delegate::Untyped ? expected : 1); QCOMPARE(delegate->property("modelX").toDouble(), expected); + QCOMPARE(modelChangedSpy.count(), expectedModelUpdates); + + aAt0 = -1; + QMetaObject::invokeMethod(tableView, "aAt0", Q_RETURN_ARG(double, aAt0)); + QCOMPARE(aAt0, writeShouldPropagate ? expected : 11); } void tst_QQuickTableView::checkVisualRowColumnAfterReorder() diff --git a/tests/auto/quickcontrols/qquickcontextmenu/data/mouseAreaUnderTextArea.qml b/tests/auto/quickcontrols/qquickcontextmenu/data/mouseAreaUnderTextArea.qml new file mode 100644 index 0000000000..5e4f727650 --- /dev/null +++ b/tests/auto/quickcontrols/qquickcontextmenu/data/mouseAreaUnderTextArea.qml @@ -0,0 +1,21 @@ +import QtQuick +import QtQuick.Controls + +ApplicationWindow { + id: window + width: 400 + height: 400 + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.LeftButton + + onPressed: (mouse) => window.color = "red" + + TextArea { + anchors.centerIn: parent + text: "Hello, World!" + color: "black" + } + } +} diff --git a/tests/auto/quickcontrols/qquickcontextmenu/tst_qquickcontextmenu.cpp b/tests/auto/quickcontrols/qquickcontextmenu/tst_qquickcontextmenu.cpp index db7a3457b3..333fd55095 100644 --- a/tests/auto/quickcontrols/qquickcontextmenu/tst_qquickcontextmenu.cpp +++ b/tests/auto/quickcontrols/qquickcontextmenu/tst_qquickcontextmenu.cpp @@ -6,13 +6,20 @@ #include <QtTest/qsignalspy.h> #include <QtTest/qtest.h> #include <QtQuick/qquickview.h> +#include <QtQuick/private/qquickmousearea_p.h> #include <QtQuick/private/qquicktaphandler_p.h> #include <QtQuickTestUtils/private/viewtestutils_p.h> #include <QtQuickTestUtils/private/visualtestutils_p.h> +#include <QtQuickControlsTestUtils/private/controlstestutils_p.h> #include <QtQuickControlsTestUtils/private/qtest_quickcontrols_p.h> #include <QtQuickTemplates2/private/qquickmenu_p.h> +#include <QtQuickTemplates2/private/qquickmenu_p_p.h> #include <QtQuickTemplates2/private/qquickmenuitem_p_p.h> +#include <QtQuickTemplates2/private/qquickpopupwindow_p_p.h> +#include <QtQuickTemplates2/private/qquicktextarea_p.h> +#include <QtQuickTest/quicktest.h> +using namespace QQuickControlsTestUtils; using namespace QQuickVisualTestUtils; class tst_QQuickContextMenu : public QQmlDataTest @@ -38,6 +45,7 @@ private slots: void explicitMenuPreventsBuiltInMenu(); void menuItemShouldntTriggerOnRelease(); void textControlsMenuKey(); + void mouseAreaUnderTextArea(); private: bool contextMenuTriggeredOnRelease = false; @@ -401,6 +409,52 @@ void tst_QQuickContextMenu::textControlsMenuKey() } } +void tst_QQuickContextMenu::mouseAreaUnderTextArea() +{ + if (!arePopupWindowsSupported()) + QSKIP("The platform doesn't support popup windows. Skipping test."); + + QQuickApplicationHelper helper(this, "mouseAreaUnderTextArea.qml"); + QVERIFY2(helper.ready, helper.failureMessage()); + QQuickWindow *window = helper.window; + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + auto *textArea = window->findChild<QQuickTextArea *>(); + QVERIFY(textArea); + auto *mouseArea = window->findChild<QQuickMouseArea *>(); + QVERIFY(mouseArea); + + // Open the menu by right clicking on the TextArea. + QTest::mouseClick(window, Qt::RightButton, Qt::NoModifier, mapCenterToWindow(textArea)); + auto *menu = window->findChild<QQuickMenu *>(); + QVERIFY(menu); + QTRY_VERIFY(menu->isOpened()); + + QQuickMenuPrivate *menuPrivate = QQuickMenuPrivate::get(menu); + QVERIFY(menuPrivate); + QVERIFY(menuPrivate->usePopupWindow()); + QVERIFY(menuPrivate->popupWindow); + QVERIFY(menuPrivate->popupWindow->isActive()); + QTRY_COMPARE(QQuickTest::qIsPolishScheduled(menuPrivate->popupWindow), false); + + // Click on the menu item to close the menu; the MouseArea shouldn't emit pressed(). + auto *selectAllMenuItem = qobject_cast<QQuickMenuItem *>(menu->itemAt(menu->count() - 1)); + QVERIFY(selectAllMenuItem); + QCOMPARE(selectAllMenuItem->text(), "Select All"); + const QSignalSpy mouseAreaPressedSpy(mouseArea, &QQuickMouseArea::pressed); + QVERIFY(mouseAreaPressedSpy.isValid()); + const QSignalSpy menuItemTriggeredSpy(selectAllMenuItem, &QQuickMenuItem::triggered); + QVERIFY(menuItemTriggeredSpy.isValid()); + const QPointF menuItemCenter(selectAllMenuItem->width() / 2, selectAllMenuItem->height() / 2); + const QPoint posGlobal = selectAllMenuItem->mapToGlobal(menuItemCenter).toPoint(); + const QPoint posMainWindowLocal = window->mapFromGlobal(posGlobal); + QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, posMainWindowLocal); + QTRY_COMPARE(menuItemTriggeredSpy.size(), 1); + QCOMPARE(mouseAreaPressedSpy.size(), 0); + QTRY_COMPARE(menuPrivate->popupWindow->isVisible(), false); +} + QTEST_QUICKCONTROLS_MAIN(tst_QQuickContextMenu) #include "tst_qquickcontextmenu.moc" diff --git a/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp b/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp index d9e8b893db..1055dfc4f8 100644 --- a/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp +++ b/tests/auto/quickcontrols/qquickmenu/tst_qquickmenu.cpp @@ -145,7 +145,7 @@ QVERIFY2(actualMenuItem == expectedMenuItem, \ .arg(QDebug::toString(actualMenuItem), QDebug::toString(expectedMenuItem)))); tst_QQuickMenu::tst_QQuickMenu() - : QQmlDataTest(QT_QMLTEST_DATADIR) + : QQmlDataTest(QT_QMLTEST_DATADIR, FailOnWarningsPolicy::FailOnWarnings) { std::unique_ptr<QPlatformMenu> platformMenu(QGuiApplicationPrivate::platformTheme()->createPlatformMenu()); nativeMenuSupported = platformMenu != nullptr; diff --git a/tests/auto/quickshapes/designhelpers/CMakeLists.txt b/tests/auto/quickshapes/designhelpers/CMakeLists.txt index 28a4c49916..7c6b57ec6e 100644 --- a/tests/auto/quickshapes/designhelpers/CMakeLists.txt +++ b/tests/auto/quickshapes/designhelpers/CMakeLists.txt @@ -7,5 +7,6 @@ if(QT_BUILD_MINIMAL_STATIC_TESTS) endif() if(QT_FEATURE_private_tests) + add_subdirectory(qquickellipseshape) add_subdirectory(qquickrectangleshape) endif() diff --git a/tests/auto/quickshapes/designhelpers/qquickellipseshape/CMakeLists.txt b/tests/auto/quickshapes/designhelpers/qquickellipseshape/CMakeLists.txt new file mode 100644 index 0000000000..def66085d9 --- /dev/null +++ b/tests/auto/quickshapes/designhelpers/qquickellipseshape/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright (C) 2025 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qquickellipseshape LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + data/*) +list(APPEND test_data ${test_data_glob}) + +qt_internal_add_test(tst_qquickellipseshape + SOURCES + tst_qquickellipseshape.cpp + LIBRARIES + Qt::CorePrivate + Qt::Gui + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickShapesPrivate + Qt::QuickShapesDesignHelpersPrivate + Qt::QuickTestUtilsPrivate + TESTDATA ${test_data} +) + +qt_internal_extend_target(tst_qquickellipseshape CONDITION TARGET Qt::Widgets + LIBRARIES + Qt::Widgets +) + +qt_internal_extend_target(tst_qquickellipseshape CONDITION ANDROID OR IOS + DEFINES + QT_QMLTEST_DATADIR=":/data" +) + +qt_internal_extend_target(tst_qquickellipseshape CONDITION NOT ANDROID AND NOT IOS + DEFINES + QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/data" +) diff --git a/tests/auto/quickshapes/designhelpers/qquickellipseshape/data/default.qml b/tests/auto/quickshapes/designhelpers/qquickellipseshape/data/default.qml new file mode 100644 index 0000000000..b346f36e83 --- /dev/null +++ b/tests/auto/quickshapes/designhelpers/qquickellipseshape/data/default.qml @@ -0,0 +1,12 @@ +import QtQuick +import QtQuick.Shapes.DesignHelpers + +Item { + width: 256 + height: 256 + + EllipseShape { + objectName: "ellipseShape" + anchors.centerIn: parent + } +} diff --git a/tests/auto/quickshapes/designhelpers/qquickellipseshape/data/ellipseshape1.qml b/tests/auto/quickshapes/designhelpers/qquickellipseshape/data/ellipseshape1.qml new file mode 100644 index 0000000000..03bf8f9560 --- /dev/null +++ b/tests/auto/quickshapes/designhelpers/qquickellipseshape/data/ellipseshape1.qml @@ -0,0 +1,5 @@ +import QtQuick +import QtQuick.Shapes.DesignHelpers + +EllipseShape { +} diff --git a/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp b/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp new file mode 100644 index 0000000000..57fe2eb0c0 --- /dev/null +++ b/tests/auto/quickshapes/designhelpers/qquickellipseshape/tst_qquickellipseshape.cpp @@ -0,0 +1,117 @@ +// Copyright (C) 2025 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtTest/QtTest> +#include <QtQuick/qquickview.h> +#include <QtQuickTest/quicktest.h> +#include <QtQuickTestUtils/private/viewtestutils_p.h> +#include <QtQuickTestUtils/private/visualtestutils_p.h> +#include <QtQuickShapesDesignHelpers/private/qquickellipseshape_p.h> + +class tst_QQuickEllipseShape : public QQmlDataTest +{ + Q_OBJECT +public: + tst_QQuickEllipseShape(); + +private slots: + void initTestCase() override; + void basicShape(); + void changeSignals(); + void changeSignals_data(); + +private: + QScopedPointer<QQuickView> window; +}; + +tst_QQuickEllipseShape::tst_QQuickEllipseShape() : QQmlDataTest(QT_QMLTEST_DATADIR) { } + +void tst_QQuickEllipseShape::initTestCase() +{ + QQmlDataTest::initTestCase(); + window.reset(QQuickViewTestUtils::createView()); +} + +void tst_QQuickEllipseShape::basicShape() +{ + QQmlEngine engine; + QQmlComponent c(&engine, testFileUrl("ellipseshape1.qml")); + QQuickEllipseShape *ellipseShape = qobject_cast<QQuickEllipseShape *>(c.create()); + QVERIFY(ellipseShape); + + QCOMPARE(ellipseShape->sweepAngle(), 360); + QCOMPARE(ellipseShape->startAngle(), 0); + QCOMPARE(ellipseShape->width(), 100); + QCOMPARE(ellipseShape->height(), 100); + QCOMPARE(ellipseShape->cornerRadius(), 10); + QCOMPARE(ellipseShape->innerArcRatio(), 0); + QCOMPARE(ellipseShape->hideLine(), false); + QCOMPARE(ellipseShape->strokeWidth(), 4); + QCOMPARE(ellipseShape->dashOffset(), 0); + QCOMPARE(ellipseShape->capStyle(), QQuickShapePath::SquareCap); + QCOMPARE(ellipseShape->joinStyle(), QQuickShapePath::BevelJoin); + QCOMPARE(ellipseShape->strokeStyle(), QQuickShapePath::SolidLine); + QCOMPARE(ellipseShape->borderMode(), QQuickEllipseShape::BorderMode::Inside); + QCOMPARE(ellipseShape->strokeColor(), QColor(Qt::black)); + QCOMPARE(ellipseShape->fillColor(), QColor(Qt::white)); +} + +void tst_QQuickEllipseShape::changeSignals_data() +{ + QTest::addColumn<QVariant>("propertyValue"); + QTest::addColumn<QMetaMethod>("changeSignal"); + + QTest::newRow("sweepAngle") << QVariant::fromValue(180) + << QMetaMethod::fromSignal(&QQuickEllipseShape::sweepAngleChanged); + QTest::newRow("startAngle") << QVariant::fromValue(90) + << QMetaMethod::fromSignal(&QQuickEllipseShape::startAngleChanged); + QTest::newRow("cornerRadius") << QVariant::fromValue( + 20) << QMetaMethod::fromSignal(&QQuickEllipseShape::cornerRadiusChanged); + QTest::newRow("innerArcRatio") + << QVariant::fromValue(0.5f) + << QMetaMethod::fromSignal(&QQuickEllipseShape::innerArcRatioChanged); + QTest::newRow("hideLine") << QVariant::fromValue(true) + << QMetaMethod::fromSignal(&QQuickEllipseShape::hideLineChanged); + QTest::newRow("strokeColor") << QVariant::fromValue( + QColor(Qt::blue)) << QMetaMethod::fromSignal(&QQuickEllipseShape::strokeColorChanged); + QTest::newRow("strokeWidth") << QVariant::fromValue( + 0) << QMetaMethod::fromSignal(&QQuickEllipseShape::strokeWidthChanged); + QTest::newRow("fillColor") << QVariant::fromValue(QColor(Qt::blue)) + << QMetaMethod::fromSignal(&QQuickEllipseShape::fillColorChanged); + QTest::newRow("joinStyle") << QVariant::fromValue(QQuickShapePath::RoundJoin) + << QMetaMethod::fromSignal(&QQuickEllipseShape::joinStyleChanged); + QTest::newRow("capStyle") << QVariant::fromValue(QQuickShapePath::RoundCap) + << QMetaMethod::fromSignal(&QQuickEllipseShape::capStyleChanged); + QTest::newRow("strokeStyle") << QVariant::fromValue(QQuickShapePath::DashLine) + << QMetaMethod::fromSignal( + &QQuickEllipseShape::strokeStyleChanged); + QTest::newRow("dashOffset") << QVariant::fromValue(4) + << QMetaMethod::fromSignal(&QQuickEllipseShape::dashOffsetChanged); + QTest::newRow("dashPattern") << QVariant::fromValue(QList<qreal>{ + 1, 2 }) << QMetaMethod::fromSignal(&QQuickEllipseShape::dashPatternChanged); + QTest::newRow("borderMode") << QVariant::fromValue(QQuickEllipseShape::BorderMode::Outside) + << QMetaMethod::fromSignal(&QQuickEllipseShape::borderModeChanged); +} + +void tst_QQuickEllipseShape::changeSignals() +{ + window->setSource(testFileUrl("default.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window.get())); + QVERIFY(window->status() == QQuickView::Ready); + + QFETCH(const QVariant, propertyValue); + QFETCH(const QMetaMethod, changeSignal); + + QQuickEllipseShape *ellipseShape = QQuickVisualTestUtils::findItem<QQuickEllipseShape>( + window->rootObject(), "ellipseShape"); + QVERIFY(ellipseShape); + const QSignalSpy signalSpy(ellipseShape, changeSignal); + QVERIFY(signalSpy.isValid()); + QVERIFY(ellipseShape->setProperty(QTest::currentDataTag(), propertyValue)); + QCOMPARE(signalSpy.count(), 1); +} + +QTEST_MAIN(tst_QQuickEllipseShape) + +#include "tst_qquickellipseshape.moc" diff --git a/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml b/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml new file mode 100644 index 0000000000..9e711b1472 --- /dev/null +++ b/tests/baseline/scenegraph/data/designhelpers/designhelpers_ellipseshape.qml @@ -0,0 +1,223 @@ +import QtQuick +import QtQuick.Shapes +import QtQuick.Shapes.DesignHelpers + +Rectangle { + width: 800 + height: 800 + color:"#b5e7a0" + + component TestEllipseShape : EllipseShape { + fillColor: "#37c1ff" + strokeColor: "#663333" + width: 90 + height: 90 + } + + Flow { + spacing: 2 + anchors.fill: parent + EllipseShape {} // default + TestEllipseShape { + startAngle: 0 + sweepAngle: 180 + cornerRadius: 0 + strokeStyle: ShapePath.DashLine + capStyle: ShapePath.FlatCap + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 270 + cornerRadius: 0 + strokeStyle: ShapePath.DashLine + capStyle: ShapePath.SquareCap + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 360 + strokeStyle: ShapePath.DashLine + capStyle: ShapePath.RoundCap + } + TestEllipseShape { + startAngle: -90 + sweepAngle: 360 + innerArcRatio: 0.5 + } + TestEllipseShape { + startAngle: -90 + sweepAngle: 350 + cornerRadius: 0 + innerArcRatio: 0.5 + strokeWidth: 1 + } + TestEllipseShape { + startAngle: -90 + sweepAngle: 180 + cornerRadius: 0 + strokeStyle: ShapePath.DashLine + } + TestEllipseShape { + startAngle: -360 + sweepAngle: 360 + } + TestEllipseShape { + id: ellipseId + startAngle: 360 + sweepAngle: -360 + strokeWidth: 1 + fillGradient: RadialGradient { + focalX: ellipseId.width * 0.5 + focalY: ellipseId.height * 0.75 + centerX: ellipseId.width * 0.5 + centerY: ellipseId.height * 0.5 + centerRadius: ellipseId.width * 0.5 + GradientStop { position:0.1; color:"cyan" } + GradientStop { position:0.2; color:"green" } + GradientStop { position:0.4; color:"red" } + GradientStop { position:0.6; color:"yellow" } + GradientStop { position:1.0; color:"blue" } + } + } + TestEllipseShape { + startAngle: -360 + sweepAngle: 360 + innerArcRatio: 1 + fillGradient: LinearGradient { + x1: 20 + y1: 20 + x2: 100 + y2: 100 + GradientStop { position: 0.0; color: "red" } + GradientStop { position: 0.33; color: "yellow" } + GradientStop { position: 1.0; color: "green" } + } + } + TestEllipseShape { + startAngle: -360 + sweepAngle: 360 + fillColor: "transparent" + } + TestEllipseShape { + startAngle: -360 + sweepAngle: 360 + innerArcRatio: 0.9 + strokeWidth: 2 + } + TestEllipseShape { + startAngle: 360 + sweepAngle: 240 + cornerRadius: 0 + innerArcRatio: 0.7 + strokeWidth: 2 + } + TestEllipseShape { + startAngle: -90 + sweepAngle: 270 + innerArcRatio: 0.5 + strokeWidth: 2 + } + TestEllipseShape { + startAngle: 360 + sweepAngle: -270 + innerArcRatio: 0.5 + strokeWidth: 2 + strokeStyle: ShapePath.DashLine + } + TestEllipseShape { + innerArcRatio: 0.7 + } + TestEllipseShape { + startAngle: 270 + sweepAngle: 360 + innerArcRatio: 0 + strokeWidth: 1 + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 320 + strokeWidth: 2 + strokeStyle: ShapePath.DashLine + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 320 + strokeWidth: 2 + strokeStyle: ShapePath.DashLine + innerArcRatio: 0.5 + cornerRadius: 0 + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 320 + strokeWidth: 2 + strokeStyle: ShapePath.DashLine + innerArcRatio: 0.5 + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 360 + borderMode: EllipseShape.Inside + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 360 + borderMode: EllipseShape.Middle + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 360 + borderMode: EllipseShape.Outisde + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 270 + cornerRadius: 0 + strokeWidth: 2 + hideLine: true + fillColor: "transparent" + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 270 + cornerRadius: 0 + strokeWidth: 2 + hideLine: false + fillColor: "transparent" + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 360 + strokeStyle: ShapePath.DashLine + dashPattern: [1,2] + dashOffset: 2 + } + TestEllipseShape { + startAngle: 0 + sweepAngle: 360 + strokeStyle: ShapePath.DashLine + dashPattern: [2,4] + dashOffset: 4 + } + TestEllipseShape { + startAngle: 360 + sweepAngle: 323 + strokeStyle: ShapePath.DashLine + strokeWidth: 3 + joinStyle: ShapePath.BevelJoin + } + TestEllipseShape { + startAngle: 360 + sweepAngle: 323 + strokeStyle: ShapePath.DashLine + strokeWidth: 3 + joinStyle: ShapePath.MiterJoin + } + TestEllipseShape { + startAngle: 360 + sweepAngle: 323 + strokeStyle: ShapePath.DashLine + strokeWidth: 3 + joinStyle: ShapePath.RoundJoin + } + } +} diff --git a/tests/manual/qmlls-cmake-builds/Main.qml b/tests/manual/qmlls-cmake-builds/Main.qml index bd0c21ae63..5c05043ac8 100644 --- a/tests/manual/qmlls-cmake-builds/Main.qml +++ b/tests/manual/qmlls-cmake-builds/Main.qml @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick -import autoGenCMake +import AutoGenCMake Window { width: 640 @@ -10,5 +10,9 @@ Window { visible: true title: qsTr("Hello World") - HelloWorld { myP: 55; myPPP: 55 } + HelloWorld { + myP: 55 + myPPP: 55 + invalid: 123 + } } |