summaryrefslogtreecommitdiffstats
path: root/src/core/aspects/qabstractaspect.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace old Q_DECL statements with modern C++Allan Sandfeld Jensen2020-11-021-1/+1
| | | | | | | | Since we have long depended on C++11 now, all of these can go. Change-Id: I8808af2cd5ce192864c636b521dadd7de189563b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use QList instead of QVector in implementation and docsJarek Kobus2020-07-091-3/+3
| | | | | | | | | Fix some const correctness. Use list-initialization. Task-number: QTBUG-84469 Change-Id: I9c56742581f48f89a3b02e4121fae414117c7a25 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAspectJob: switch to using std::vectorPaul Lemire2020-07-021-4/+6
| | | | | Change-Id: I1314bd4d37ad17442ebd6287f571e41bc5d25490 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Add ; to Q_UNUSEDLars Schmertmann2020-06-241-2/+2
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I2e126d0be8efa0aa89c4a91a681b549f38c8cec4 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add support for aspects depending on other aspectsMike Krus2020-03-021-0/+5
| | | | | | | | | | Aspect can define a list of aspect names it depends one. When it is registered, these will be automatically created if they don't exist already. Change-Id: I12852751a6646ad09d09a6958d059ccf2b2e324d Caveat: this only works with named aspects. Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add public API for working with jobsMike Krus2020-03-021-0/+22
| | | | | | | | | | | | | | Existing jobs used private API for doing work after jobs were run or controlling if running was required or not. Make this public so that new jobs in custom aspects don't need to use private API. Unfortunately, this requires changing the signature of one public method that mistakenly was using a private class as a parameter. Change-Id: Ie8315a0f98ec48f84650163b4ac713e7e6845a92 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add QBackendNode::syncFromFrontEnd to public APIMike Krus2020-02-271-5/+5
| | | | | | | | | Removes need to per aspect overrides of QAbstractAspectPrivate::syncDirtyFrontEndNode which was required in Qt5 to preserve BC. Change-Id: Ib3b05af1c3ded1c985d35e4dec0fe203cdc907cb Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove deprecated classes and functionsPaul Lemire2020-02-111-200/+38
| | | | | | | Mostly old messaging API Change-Id: I17eb2206b2ede56d2f7d36375d5e711d6149019f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Clean up tracing codeMike Krus2020-01-271-2/+5
| | | | | | | | | | - Removed some old optional timing code. - Separated jobsDone into 2 parts since, on single threaded rendering mode (ie macOS), the render aspect blocks until the next vsync which confuses tracing Change-Id: Icb641e3f8079da2cb9af0416b0f7c4dc4dd36c3c Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Use jobsDone to sync render capture back to frontendMike Krus2019-12-131-2/+2
| | | | | | | | | | | Removes the jobs who's only purpose was to send a message to the frontend. Now added a jobsDone() call to render which is called from main thread when jobs are completed, so it's safe to sync data to frontend. Added a task trace for the backend to front end synching. Change-Id: I587462bea353c5d5a0065b542adcacef4dedb05f Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Make NodeRelationshipChange struct privateMike Krus2019-12-061-14/+2
| | | | | | | Was private in 5.14, should remain so in 5.15 Change-Id: I74231d349e60f498d8ffb4ff39cc1e95fa3f0567 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Revert "Fix post FF API changes"Mike Krus2019-12-031-9/+21
| | | | | | | 84766ed9098f10efc53e4e43a75eef38fce7fbf6 Change-Id: I12341ec1b7bc68a7586c6671aa7b8f21caed17e0 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Disable threaded rendering macOS 10.14 and laterMike Krus2019-11-141-0/+5
| | | | | | | | | | | | | | | | Making context current from background thread crashes on Catalina. In this case, we disable threaded rendering. This implies changes in the order in which initialization and rendering happens. We can't just rely on rendering type since Scene3D is not threaded but has it's own initialization logic. Ideally 5.15 should introduce proper API since currently manually setting a QWindow based app to use Synchronous rendering will hang at initialization time. Task-number: QTBUG-80049 Change-Id: Ic346a44d8e0add8232a16129e878423f4cf2f4f1 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Fix post FF API changesMike Krus2019-10-221-21/+9
| | | | | Change-Id: I347f6df41c0a4f2295831e78248669b4a2d6b5ef Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove use of node/components added/removed messagesMike Krus2019-10-041-0/+108
| | | | | | | | | | | | | Introduce mechanism to notify backend nodes of changes in relationship between nodes. If a component is added or removed from an entity, or if a node is added or removed from a property of another node, then just rely on the node being marked as dirty when syncing takes place. For nodes that do not support syncing, messages are delivered as before but allocated on the stack rather than the heap. Change-Id: I06affac77e42a9998d9c7f44e231c7724c52b320 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use direct access to remove backend nodesPaul Lemire2019-09-161-53/+36
| | | | | | | | | - Stop using messages - Remove QSceneObserverInterface - Ensure backend node creation/destruction is done at the right time Change-Id: I470825af344ab65bf05e93fc149b61d1b9eefc96 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove QBackendNodeFactory since it's no longer neededMike Krus2019-09-051-7/+0
| | | | | | | | (wasn't really needed before) Change-Id: I213da50ec995015e7a70f2ea1e5c5557f038be0e Reviewed-by: Jim Albamont <jim.albamont@kdab.com> Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Use sync method when initializing new backend nodesMike Krus2019-08-291-33/+56
| | | | | | | | | | | If the node type supports syncing, use that rather than the creation message. The message is still needed since that is passed to the instantiation functor (none of qt3d's classes appear to use anything but the node id, but can't be sure no other classes do, and can't add other virtual method without breaking BC). Change-Id: Id99f448070b8722a7809b968798772c9eb3c8397 Reviewed-by: Mike Krus <mike.krus@kdab.com>
* Do direct notification of backend nodeswip/refactorMike Krus2019-08-281-3/+99
| | | | | | | | | | | | | | | | | Since aspect manager is now on main thread, we can directly update backend nodes safely. Track nodes which have changed properties and notify the backend nodes as part of the frame loop. This avoid allocating and delivering many change messages. To follow: - implement on all nodes - look at backend to frontend syncing - figure out what to do with non property messages (components added/removed, commands, ...) Change-Id: Ia0c442b0528e728c4324d168200bae021bc29266 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Doc: Add QT3D_REGISTER_ASPECT macro documentationPaul Wicking2018-11-061-0/+20
| | | | | | | | Also remove two '*' that ended up in the generated docs. Task-number: QTBUG-65413 Change-Id: Ia0870405f73166dbb73ee09e34e7625c51486b41 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix documentation warnings for Qt 3D CoreTopi Reinio2018-02-161-7/+1
| | | | | | | | | | | | This change fixes multiple QDoc warnings for Qt 3D Core that are related to how Clang parses the source code and the \fn QDoc commands. We still have a number of 'No documentation for ...' warnings left - those are not addressed in this change. Change-Id: Ia6394f453d7bd959bc4d4cc9347ac0039b80f661 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Prevent potential containers detachingMike Krus2018-01-141-1/+2
| | | | | | | Found by Clazy clazy-range-loop Change-Id: I4956f9be2b7b3f986b2fc83c1d883829314a8b6c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Initialize QBackendNodes after setting arbiterJan Marker2017-07-181-2/+3
| | | | | Change-Id: Ib329915e7962b0e60b0cbb66e5801f4a96fdf23a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add support for single shot jobsMike Krus2017-05-221-1/+16
| | | | | | | | QAbstractAspect includes a list of jobs that will only be run once. The list is added in jobsToExecute and then cleared. Change-Id: I5849c643a06d8e4e81bbc55d610851de05087934 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge branch '5.8' into 5.9Sean Harmer2017-04-021-7/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/jobs/qthreadpooler.cpp src/core/nodes/qcomponent.cpp src/core/qpostman.cpp src/core/qscene_p.h src/core/services/qservicelocator_p.h src/input/frontend/qinputaspect.cpp src/plugins/sceneparsers/assimp/assimpimporter.cpp src/plugins/sceneparsers/assimp/assimpimporter.h src/plugins/sceneparsers/gltf/gltfimporter.h src/plugins/sceneparsers/gltf/gltfio.cpp src/quick3d/imports/core/qt3dquick3dcoreplugin.cpp src/quick3d/imports/extras/qt3dquick3dextrasplugin.cpp src/quick3d/imports/render/qt3dquick3drenderplugin.cpp src/quick3d/quick3dextras/qt3dquickwindow.cpp Change-Id: I3566708c6f74a34959e7bb64b64e93647ca3f699
| * Fixes includes to comply with coding conventions for Src/CoreRobert Brock2017-03-311-7/+9
| | | | | | | | | | | | | | | | Reordering the header includes to comply with Qt coding conventions Task-number: QTBUG-56185 Change-Id: I3943678c183c4ef46d403e0fff878c3cad964dfa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Load render pluginsAntti Määttä2017-01-271-0/+6
|/ | | | | | Change-Id: I035a4d1fa41988514551425917d6fd735a790b05 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Doc: Specify #include path for each \classTopi Reinio2016-12-071-0/+1
| | | | | | | | | | | | QDoc tries to guess the correct #include statement, displayed in the requisites table in the class reference. However, this often produces incorrect information for a module as complex as Qt3D. To fix this, manually specify the include path with the \inheaderfile command. Change-Id: I42929b92600d07d759f4f76e9051ff656785c652 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add AspectCommandDebuggerPaul Lemire2016-07-051-0/+23
| | | | | | | | | Will allow to send command and replies from remote applications to Qt3D. Also added the class AsynchronousCommandReply which will behave basically like QNetworkReply for internal commands; Change-Id: Ia130f96387fb200658eb46a05e581abe9ef78f63 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Unit tests for layer filtering jobPaul Lemire2016-07-021-1/+1
| | | | | Change-Id: I15f9d1105a08a72e03c89da7b2c61c0ab88ee880 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Do not create OpenGL context until render aspect is registeredSean Harmer2016-07-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | This avoids a race where the renderer creates a context based on the default format when the render aspect is created. The alternative fix would have been to simply create the QRenderAspect after setting the default surface format. However, that would mean being careful to do that everywhere in the future too. This fixes it more neatly and completely by creating the renderer in the render aspect's onRegistered() function. Whilst in there, this also solves the previous asymmetry in the onRegistered() and onUnregistred() functions. We now also unregister backend types and re-register them in onRegistered. This is necessary because the mappers depend upon the renderer. Also added a todo to make the unregisterBackendType() functions public for 5.8. Task-number: QTBUG-54370 Task-number: QTBUG-53880 Change-Id: I09a774739df069d3210ed0efe6dd504d968b05f3 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* initializeFromPeer last when creating backend nodeKevin Ottens2016-05-231-1/+3
| | | | | | | | | This fixes issue with the focus handling in KeyHandler since initializeFromPeer checks the enabled state to request focus or not. Change-Id: Ib33f6a7fcec3cb96c1a71b3e6ba0be5f8eb942ed Task-number: QTBUG-53358 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Use some constructor delegationMarc Mutz2016-05-141-3/+2
| | | | | | | | | | | | | to avoid code duplication (in both: executable and source code senses). Text size savings on optimized GCC 6.0 Linux AMD64 builds: Core: 16 Logic: 192 Input: -304 Render: 408 Change-Id: I23dd01fd4efe226c22942c24b21bbe20027c90b1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QNodePropertyChange -> QPropertyUpdatedChangeSean Harmer2016-05-101-1/+1
| | | | | | Task-number: QTBUG-51494 Change-Id: Ic326499f80b5a91b2d19c09770de926f220cc805 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Q_NULLPTR -> nullptrSean Harmer2016-05-011-8/+8
| | | | | | Task-number: QTBUG-52736 Change-Id: I58f9cbcdf018e7b672d33dd865067485412b79fe Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* QAbstractAspect: remove all traces of cloningPaul Lemire2016-05-011-58/+5
| | | | | Change-Id: I9ff89f440d91740a9d9e163707d87ad13022e51b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QAbstractAspect: remove cloning code pathPaul Lemire2016-05-011-28/+6
| | | | | Change-Id: I08fe3006bc7a2fb7b35d253f4356b8e6826d9935 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* De-inline some polymorphic dtorsMarc Mutz2016-04-281-0/+11
| | | | | | | | | Helps avoid duplicated vtables and code (an out-of-line copy always needs to exist for the vtable to point at). Change-Id: I882552532cdba28a136542f3497f571d1593bac3 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Rename QScenePropertyChange -> QNodePropertyChangeSean Harmer2016-04-211-3/+3
| | | | | | | Trying to unify naming of change types. Change-Id: I0bfca0b7ba5adeaaa6145f75ddb41731f76adc09 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Added the rest of Qt3DCore doc skeletonsTomi Korpipää2016-04-211-33/+51
| | | | | | | | Change-Id: I6898bdc24821276d44fdf5f42170143b7a0cbfd9 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> Reviewed-by: Pasi Keränen <pasi.keranen@theqtcompany.com> Reviewed-by: Antti Määttä <antti.maatta@theqtcompany.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add some categorized debugging to QAbstractAspect node operationsSean Harmer2016-04-151-4/+5
| | | | | Change-Id: Ia70fc229030513281971bdd3eee3efae9133aafd Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move enabled property to QBackendNodePaul Lemire2016-04-141-6/+7
| | | | | Change-Id: I30e40a89041d7ff12c7bb7117d1e91d9d4244647 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add branches to optionally use the no cloning approach in aspectsSean Harmer2016-04-121-11/+21
| | | | | | | For creating/destroying nodes dynamically. Change-Id: I6328bc2f71d30c43b54f10a8f5667c3ac70f0153 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add no cloning version of QAbstractAspectPrivate::clearBackendNode()Sean Harmer2016-04-121-0/+32
| | | | | Change-Id: If2d290c15f8d7ffaed40083ecc6a5daf5686d274 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Query cloning vs no cloning once (per aspect)Sean Harmer2016-04-121-2/+2
| | | | | | | | This will allow to try out the no cloning approach on hotter code paths without readign the environment variable every time. Change-Id: I5cd4532ef942496640b09984784eb80e2203ebce Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Add setPeer() function to QBackendNodeSean Harmer2016-03-221-1/+3
| | | | | | | | We only deal with QNodeIds on the backend with the new method. Task-number: QTBUG-51835 Change-Id: I226b5298e1e38e5e5b94169b0145792be1d5520a Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Hook up some machinery ready for testing the no cloning approachSean Harmer2016-03-221-3/+48
| | | | | | Task-number: QTBUG-51835 Change-Id: I4520bf38acc9b8a990d3f3bce3d96f2014c5637b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add QAbstractAspectPrivate::onEngineAboutToShutdown() virtualSean Harmer2016-03-201-0/+8
| | | | | | | | | | Gives internal aspects a chance to unqueue any queued work that could potentially deadlock during trying to exit the inner loop in QAspectManager::exec(). Task-number: QTBUG-51421 Change-Id: I8f9892db2d8648c39092720f1a787c4db412d30d Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Remove QAbstractAspect::onCleanup()Sean Harmer2016-03-171-4/+0
| | | | | | | | | | | This was actually called both when unsetting a root entity and during final shutdown. Remove it and move work it was doing to the overrides of onUnregistered() for now. Will need another look when we finish this refactoring to also include backend node destruction. Task-number: QTBUG-51421 Change-Id: I2f96ede4006fea3a4766d15cf6e162452dd58321 Reviewed-by: Kevin Ottens <kevin.ottens@kdab.com>
* Remove QAbstractAspect::onRootEntityChangedSean Harmer2016-03-171-7/+1
| | | | | | | | No longer needed, as we can do all needed in onEngineStartup(). Task-number: QTBUG-51421 Change-Id: I64487b9f118aaad073e4e060bc5fd36f3a6dd16a Reviewed-by: Sean Harmer <sean.harmer@kdab.com>