aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlscriptstring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQmlScriptString: Guard operator== against nullptrFabian Kosmale2023-10-311-1/+1
| | | | | | | | | Amends 015a1ed8e06c92a8dc788ab71f42f1c247e99405. Fixes: QTBUG-118591 Pick-to: 6.6 Change-Id: If6352d689f8c344e5e0c859caf0f52533c665251 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Qml: Fix QQmlScriptString::isEmpty()Ulf Hermann2023-04-191-1/+3
| | | | | | | | A QQmlScriptString without a d pointer is indeed empty. Task-number: QTBUG-112859 Change-Id: Ic3aea676403bd815e73d26733392c7f6ac8b84b8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlScriptString: Avoid allocation in default constructed stateFabian Kosmale2023-04-131-9/+11
| | | | | | | | | | Classes like QQuickAnchorSetPrivate have multiple script string properties, most of them being unused. Avoid allocating memory in that case by simply letting the d pointer be null, and adding null-checks in the various accessor methods. Change-Id: I4b7a1298c4a5892028174b82c3a92ccd93bdf65e Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Qml: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102948 Change-Id: Ie39c60a19ba562affe6bd52ba68b38db95298cf3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Qml: replace QStringLiteral with QLatin1StringAnton Kudryavtsev2016-02-101-8/+8
| | | | | | | ... in string comparisons. It's more efficient. Change-Id: I3be5a2be9ba5d55546472eac28f5f639a496bf3b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* QSM: Reintroduce guard argument evaluationSebastian Sauer2014-08-251-0/+38
| | | | | | | | | | | | | | Implements the suggestion from Simon Hausmann (codereview 89716 from 08-05 14:46) to use QQmlScriptString rather then the previous used MetaObject-manipulation. This also introduces comparison operators for QQmlScriptString to be able to determinate if a QQmlScriptString changed what is needed cause there is otherwise no way to access (all) the needed details within QQmlScriptStringPrivate. Change-Id: I198479eac8fd37cbdd98a99aacdd8eebf7b75d21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix QQmlScriptString::isEmpty for script strings without source codeSimon Hausmann2014-05-271-1/+3
| | | | | | | | | | The source code is not strictly required anymore and QQmlScriptString should return true with isEmpty() if the object is conceptually empty (not usable), not only when the source code is empty. It can still have a valid binding id and thus be used in QQmlExpression. Change-Id: I777717f2217d0c46e059c382761a1044881c5978 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix uses of \inmodule, \inqqmlmodule and \sinceBea Lam2012-08-081-1/+1
| | | | | | | Some classes and QML types were missing these or had the wrong values. Change-Id: Ic6376b8b450301f8ae0549e636f4bc2db4400f2b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Make QQmlScriptString opaque.Michael Brasser2012-08-031-18/+45
| | | | | | | | Allow for future optimization by encapsulating the raw script data. Change-Id: I1863103e8e6d74ede60593cabb240e16f2ae657e Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+157
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>