summaryrefslogtreecommitdiff
path: root/src/qdoc/qmlpropertynode.h
Commit message (Collapse)AuthorAgeFilesLines
* QDoc: Remove setDesignable/setScriptable from [Qml]PropertyNodeLuca Di Sera2022-09-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Properties in the Qt property system can be, among other things, "designable" and "scriptable". A property that is "designable", that is, has the `DESIGNABLE` attribute, which is by default true, will generally be visible in some of Qt's GUI editor, such as Qt Designer. A property that is "scriptable", that is, has the `SCRIPTABLE` attribute, which is by default true, will generally be accessible by scripting engines (e.g QML engine). QDoc represents properties as the `PropertyNode` and `QmlPropertyNode` classes. During the parsing phase, in `clangcodeparser`, property declarations are parsed to generate correspective `Node`s that represent them, to allow the documentation of such elements. During this process, the `DESIGNABLE` attribute and the `SCRIPTABLE` attribute are taken into account and their "value" is stored into the produced property node. Nonetheless, the state of the attribute is never accessed during a QDoc execution, as we don't show information about "designability" and "scriptability" to the user. It is currently unknown if that information could be useful to the user, such that we should show it in the output documentation or if it could be used to discern between branching paths with regards to generating the property documentation itself. At the current time, nothing of the sort is done, so that any code related to those two attributes is to be considered dead. Hence, `PropertyNode::setDesignable`, `PropertyNode::setScriptable` and `QmlPropertyNode::setDesignable` were removed. The internal members of `PropertyNode`, `m_designable` and `m_scriptable`, and `QmlPropertyNode`, `m_designable`, were removed as they are now unused. A usage of `PropertyNode::m_designable` and `PropertyNode::m_scriptable` was removed in the implementation of `PropertyNode::setOverriddenFrom`, where the members where set based on the base property that the `PropertyNode` was overriding. Furthermore, `PropertyNode::designableDefault`, which was intended to represent the default value of the `DESIGNABLE` attribute for a property, was removed as it was unused. The code in `ClangCodeParser` that took care of setting the "DESIGNABLE" and "SCRIPTABLE" attribute was removed as a consequence of the other removals. Change-Id: I36cce8e3dd91af99dd6773160fd44b596762a49e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-191-27/+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. Task-number: QTBUG-67283 Change-Id: I5335388c0472b0ee554234fc7eca60769e504660 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QDoc: Code cleanupPaul Wicking2021-05-191-14/+23
| | | | | | | | | | | | | * Unify members; use s_ or m_ prefix instead of _ suffix. * Remove unnecessary member that duplicates content in base class. * Add [[nodiscard]] annotations where applicable. * Add overloads to virtual methods that have been extended with parameters with default values. * Make single argument ctors explicit. * Remove semi-colon from namespace declaration. Change-Id: Ie1ff39079722b81ba6754f945a898dc9b335bbae Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Code cleanupPaul Wicking2021-05-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use multiple arguments for QStrings instead of calling .arg() multiple times. * Define trivial constructor/destructor '= default' instead of adding empty implementations. * Remove unreachable code. * Prefer ranged-based for loops. * Initialize with auto from static_cast<>() and new. * Simplify expressions. * Prefer "QList::empty()" over "QList::size() > 0". * Remove unused method. * Return qsizetype instead of int to avoid narrowing conversion. * Remove unused include. * Remove unreachable return statement. * Prefer raw string literals over escaped regexes. * Initialize struct members. * Make variables used as const refs const refs. * Use std::move instead of passing const ref in ctor. * Drop redundant 'virtual' from methods marked 'override'. * Make local copies that arent ever modified const refs to avoid copying. * Turn for-loop into std::any_of. * Made single-argument constructor explicit. * Don't shadow variable names from outer scope if not necessary. * Remove const at top level that does not improve const correctness. * Update copyright notice for affected classes. Task-number: QTBUG-71176 Change-Id: Ia41e5b947b72f594b60d189b6b0ff68587c3afb9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Re-implement \default commandTopi Reinio2021-03-171-0/+3
| | | | | | | | | | | | | | Marking a QML property as a default property is now done with \qmldefault command; repurpose the \default command to set a default value for a property. The default value is visible in the detailed property documentation as an extra 'default: <value>' attribute. The value is taken as-is from the argument passed to the command. Fixes: QTBUG-81525 Change-Id: I7a4395e6e96046facfc3d75cc62a3bd01d04935b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Introduce \required command and handle REQUIRED for QML propertiesTopi Reinio2020-07-151-0/+3
| | | | | | | | | | | | | | | | | | | Q_PROPERTY macro now supports the REQUIRED keyword. This is relevant for QML types, where the type cannot be instatiated without declaring all required properties. Make QDoc parse the REQUIRED keyword, set associated QML property as required, and introduce a new command, \required, to do this explicitly in the docs. Likewise in QML visitor, check for the 'required' keyword for properties. [ChangeLog][qdoc] Support marking QML properties as required in the generated documentation. Fixes: QTBUG-85597 Change-Id: Ib8a25c5ebc1183812aec6e672b557c8fb1196741 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Extract Aggregate from NodePaul Wicking2020-06-041-0/+1
| | | | | | Task-number: QTBUG-84578 Change-Id: If28cc8b41401c90dfa48b613211b3d0a4dcd815a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Extract QmlPropertyNode from NodePaul Wicking2020-06-041-0/+83
Task-number: QTBUG-84578 Change-Id: If9a8eed6a01c6c7682a47572a16213f0d174087e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>