summaryrefslogtreecommitdiffstats
path: root/tests/auto/render/qrenderpassfilter/tst_qrenderpassfilter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for test filesLucie Gérard2024-04-231-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I966d4033a73aacabb39f582270f2f1c18e2bcecd Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Port from container::count() and length() to size() - V4Marc Mutz2022-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); a.k.a qt-port-to-std-compatible-api V4 with config Scope: 'Container'. Change-Id: I3b040fa72968753048fd669c073ae80c3ba1bdad Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use SPDX license identifiersLucie Gérard2022-06-221-27/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I8105424281eed871037fa6c463871ca8829876b5 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove deprecated classes and functionsPaul Lemire2020-02-111-106/+15
| | | | | | | Mostly old messaging API Change-Id: I17eb2206b2ede56d2f7d36375d5e711d6149019f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up includesMike Krus2019-10-011-4/+0
| | | | | | | | | Remove include statements for classes that are no longer used. Makes it easier to find remaining use cases that need addressed before complete removal in Qt 6. Change-Id: I60529ba1929ad64b162d3847d5df47cde2a60dad Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Update QRenderPassFilter to use direct syncPaul Lemire2019-09-201-29/+19
| | | | | Change-Id: I50272611d13a5f24722bd5b717d2265a3ebf0b62 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* tst_QRenderPassFilter: add bookkeeping tests for filterkeys and parametersPaul Lemire2016-06-291-0/+68
| | | | | Change-Id: Iedee2dcbe3a60dee12900f7c17b6886adda6f388 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Avoid crash in QML app shutdown and actually send events in C++ appSean Harmer2016-05-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic was such that in a C++ application the QNode::setParent() function would bail out early in a C++ application when called from the destructor of its parent object. This is because by the time the child is being deleted the parent is in QObjectPrivate::deleteChildren and therefore the QNode part of the object has already been destroyed. This led to the cast in the parentNode() == parent to fail, thereby exiting the functio early and never getting into QNodePrivate::_q_setParentHelper(). In the case of a QML application, the parent has a dynamic metaobject set by the QML engine. This resulted in the cast in QNode::setParent() succeeding and we called into _q_setParentHelper(). The logic in here resulted in a crash when called from a destructor because the child had already been removed from its parent's list of children. Thus when we called QObjectPrivate::setParentHelper(), this function ended up with an index of -1 for the child in its child list (i.e. not found) and it then tried to index into the children list with this index and we then crashed. The solution in this change is to not do the full logic in QNode::setParent() and _q_setParentHelper(). Rather, we simply remove the subtree at this node from the scene and we send node destruction changes to the backend. With this we avoid the crash of QML application shutdowns and we also make sure to correctly send the node destruction changes even in the case of a C++ Qt 3D application. The backend does not yet get an opportunity to process these final changes. This will be addressed in a follow up commit. As a result of these changes many unit tests began crashing. This is because the QNode dtor is now actually doing some work, rather than bailing out of that work early when the parent is no longer a QNode. This work involves mutating the QScene object which in the unit tests did not live longer than the QNode's to which it was associated with. The unit tests have been adjusted to ensure that the arbiter and scene objects remain alive longer than the QNodes they are being used to test. Task-number: QTBUG-42353 Change-Id: I197870f48fca30656bd85c4c51346d93403fba08 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Rename QNodeRemovedPropertyChange -> QPropertyNodeRemovedChangeSean Harmer2016-05-101-3/+3
| | | | | | Task-number: QTBUG-51494 Change-Id: I1c7f1c680bc18c6201b790e96dc4023564837122 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename QNodeAddedPropertyChange -> QPropertyNodeAddedChangeSean Harmer2016-05-101-3/+3
| | | | | | Task-number: QTBUG-51494 Change-Id: I7f59bad66eb086e2249c580be2fd9f4bad159eb3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNodePropertyChange -> QPropertyUpdatedChangeSean Harmer2016-05-101-1/+1
| | | | | | Task-number: QTBUG-51494 Change-Id: Ic326499f80b5a91b2d19c09770de926f220cc805 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Rename NodeAdded/NodeRemoved ChangeFlagsSean Harmer2016-05-101-4/+4
| | | | | | | | | | | | | | | | These are not just for adding/removing QNodes. They are more general in purpose and are used for adding/removing values to/from collection based properties e.g. QVector<MyValue>. The addition/removal of QNode pointers (which we translate to QNodeIds) is just the most common case. If Q_PROPERTY/QObject gains support for properties of collections and the typical operations on them, then we will be able to catch and handle most uses of these change types in QNodePrivate just like we do for setting a Q_PROPERTY. Task-number: QTBUG-51494 Change-Id: I707de1647554a61accf81dc79bfe58b289dbff7b Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Strip out cloning subsystemSean Harmer2016-04-291-42/+22
| | | | | Change-Id: I4def54a11de0f9c676ef6b2d7bd8e723ded25ab9 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* RenderPassFilter use new added/removed change typesSean Harmer2016-04-271-14/+18
| | | | | | | | Also fix property name in backend class and only mark dirty if something actually changes. Change-Id: If992d9323415b0c63283bc943b03c6e92aedcedc Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QNode: make cleanup a private slotPaul Lemire2016-04-231-1/+1
| | | | | | | | | | QT3D_CLONEABLE now implements a default dtor that calls _q_ cleanup QT3D_CLONEABLE_CUSTOM_DTOR is used for classes that really need to implement their own dtor but they need to invoke _q_cleanup manually Change-Id: I2937a3b9edeb5a763749f0044360d78ab4461a5e Task-number: QTBUG-51464 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QScenePropertyChange -> QNodePropertyChangeSean Harmer2016-04-211-4/+4
| | | | | | | Trying to unify naming of change types. Change-Id: I0bfca0b7ba5adeaaa6145f75ddb41731f76adc09 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QVectorize QRenderPassFilterWieland Hagen2016-04-161-11/+11
| | | | | Change-Id: If24f61eaae6e4fd1f7ce89df260e44efa2f48f63 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Class QRenderPassFilter renamingRobert Brock2016-03-231-13/+13
| | | | | | | | | | includes -> matchAny addInclude -> addMatch removeInclude -> removeMatch Change-Id: Ib9288ab79b3e76ae8a8aa2f7e3f20c5386438a25 Task-number: QTBUG-51456 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAnnotation changesFranck Arrecot2016-03-171-35/+35
| | | | | | Task-number: QTBUG-51454 Change-Id: Iee08f6b1be39894c40926afb20e003d46bc735f4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unify license header usageAntti Kokko2016-01-261-17/+9
| | | | | | | | Updated license headers to use new GPL-EXCEPT header instead of LGPL3 one (in those files which will be under GPL 3 with exceptions) Change-Id: I930c6234bfe720d38c596bbc3d1f39be75a7328b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Rename Renderer -> Render throughoutSean Harmer2015-10-191-3/+3
| | | | | | | | This is for consistency between the C++ namespaces and QML imports and with the other aspects. Change-Id: I73392f138b4e519b12888f52530123e3d0ba445e Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unit Tests for QRenderPassFilterPaul Lemire2015-10-141-0/+250
Change-Id: I304a5b7a0501ccb94e0c100ae5445e6a5ddbd594 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>