aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/inlinecomponentutils_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QML: Wrap inlinecomponentutils_p.h into Qt namespaceUlf Hermann2022-05-061-0/+4
| | | | | Change-Id: Icda3f73120d61b3483a6e1024ff12e019e799b90 Reviewed-by: Fabian Kosmale <[email protected]>
* Fix typo and apply some cosmeticsUlf Hermann2022-04-111-1/+1
| | | | | | Change-Id: If51b86e1741b7e9f0e7e4d5f593496bd28cec081 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Andrei Golubev <[email protected]>
* icutils::Node: GCC 11 -Werror=maybe-uninitialized w/-fsanitize=undefinedMarc Mutz2021-12-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The quint32_le_bitfield class, like its underlying type, doesn't provide a user-defined constructor, so default-construction leaves the 'val' member uninitialized. When the user-defined assignment operator then tries to read from 'val', that is undefined behavior. Or would, if vector::resize() wouldn't value-initialize, which it is required to do. So, False Positive, but due to -Werror, we need to do something about it (value-initialize the largest union member before calling assignment). Says GCC 11 with -stc=c++20 -fsanitize=undefined -Werror: In member function ‘QSpecialIntegerBitfield<S, pos, width>& QSpecialIntegerBitfield<S, pos, width>::operator=(QSpecialIntegerBitfield<S, pos, width>::T) [with S = QLittleEndianStorageType<unsigned int>; int pos = 0; int width = 30]’, inlined from ‘icutils::Node::Node(std::vector<QV4::CompiledData::InlineComponent>::size_type)’ at qt5-build/qtbase/include/QtQml/6.3.0/QtQml/private/../../../../../../../qt5/qtdeclarative/src/qml/inlinecomponentutils_p.h:66:26, inlined from ‘constexpr void std::iota(_ForwardIterator, _ForwardIterator, _Tp) [with _ForwardIterator = __gnu_cxx::__normal_iterator<icutils::Node*, std::vector<icutils::Node> >; _Tp = int]’ at /d/gcc/11/include/c++/11.2.1/bits/stl_numeric.h:99:4, inlined from ‘void QV4::ExecutableCompilationUnit::finalizeCompositeType(QQmlEnginePrivate*, CompositeMetaTypeIds)’ at qt5/qtdeclarative/src/qml/jsruntime/qv4executablecompilationunit.cpp:444:14: qt5-build/qtbase/include/QtCore/6.3.0/QtCore/private/../../../../../../../qt5/qtbase/src/corelib/global/qendian_p.h:78:30: warning: ‘*(QSpecialIntegerBitfield<QLittleEndianStorageType<unsigned int>, 0, 30>*)((char*)&<unnamed> + offsetof(icutils::Node, icutils::Node::<unnamed>)).QSpecialIntegerBitfield<QLittleEndianStorageType<unsigned int>, 0, 30>::val’ may be used uninitialized [-Wmaybe-uninitialized] 78 | UT i = S::fromSpecial(val); | ~~~~~~~~~~~~~~^~~~~ In file included from /d/gcc/11/include/c++/11.2.1/numeric:62, from qt5/qtbase/src/corelib/tools/qhashfunctions.h:47, from qt5-build/qtbase/include/QtCore/qhashfunctions.h:1, from qt5/qtbase/src/corelib/tools/qlist.h:46, from qt5-build/qtbase/include/QtCore/qlist.h:1, from qt5/qtbase/src/corelib/kernel/qobject.h:49, from qt5-build/qtbase/include/QtCore/qobject.h:1, from qt5/qtbase/src/corelib/animation/qabstractanimation.h:43, from qt5-build/qtbase/include/QtCore/qabstractanimation.h:1, from qt5-build/qtbase/include/QtCore/QtCore:9, from qt5-build/qtdeclarative/src/qml/CMakeFiles/Qml.dir/cmake_pch.hxx:5, from <command-line>: /d/gcc/11/include/c++/11.2.1/bits/stl_numeric.h: In member function ‘void QV4::ExecutableCompilationUnit::finalizeCompositeType(QQmlEnginePrivate*, CompositeMetaTypeIds)’: /d/gcc/11/include/c++/11.2.1/bits/stl_numeric.h:99:20: note: ‘<anonymous>’ declared here 99 | *__first = __value; | ~~~~~~~~~^~~~~~~~~ Pick-to: 6.3 6.2 5.15 Change-Id: I8bbe32438489120bd005e115ea34cd816c898116 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* Encapsulate QV4::ResolvedTypeReferenceUlf Hermann2020-03-251-4/+6
| | | | | | | It's used all over the place. We need a proper interface. Change-Id: Iebe254ef3bf35503bf3fdd3639979a5db2b3449e Reviewed-by: Fabian Kosmale <[email protected]>
* Long live QML inline componentsFabian Kosmale2020-01-231-0/+161
[ChangeLog][QtQml] It is now possible to declare new QML components in a QML file via the component keyword. They can be used just as if they were declared in another file, with the only difference that the type name needs to be prefixed with the name of the containing type outside of the file were the inline component has been declared. Notably, inline components are not closures: In the following example, the output would be 42 // MyItem.qml Item { property int i: 33 component IC: Item { Component.onCompleted: console.log(i) } } // user.qml Item { property int i: 42 MyItem.IC {} } Fixes: QTBUG-79382 Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5 Reviewed-by: Ulf Hermann <[email protected]>