Warning, /sdk/doxyqml/README.md is written in an unsupported language. File is not indexed.

0001 ![coverage](https://invent.kde.org/sdk/doxyqml/badges/master/coverage.svg?job=test)
0002 
0003 # Goals
0004 
0005 Doxyqml lets you use Doxygen to document your QML classes.
0006 
0007 It integrates as a Doxygen input filter to turn .qml files into pseudo-C++
0008 which Doxygen can then use to generate documentation.
0009 
0010 # Installing
0011 
0012 Doxyqml uses the standard Python setup tools, so you can install it with pip:
0013 
0014     pip3 install doxyqml
0015 
0016 or manually with:
0017 
0018     python3 setup.py install
0019 
0020 # Telling Doxygen to use Doxyqml
0021 
0022 To tell Doxygen about Doxyqml you must make a few changes to your Doxygen
0023 configuration file.
0024 
0025 1. Add the .qml extension to the `FILTER_PATTERNS` key:
0026 
0027         FILTER_PATTERNS = *.qml=doxyqml
0028 
0029    Note: on Windows Doxyqml installs itself in the `Scripts` folder of your
0030    Python installation. If this folder is not in the PATH, either add it or use
0031    the full path to Doxyqml here (but that is less portable across machines)
0032 
0033 2. Add the .qml extension to `FILE_PATTERNS`:
0034 
0035         FILE_PATTERNS = *.qml
0036 
0037 3. Since Doxygen 1.8.8, you must also add the .qml extension to
0038    `EXTENSION_MAPPING`:
0039 
0040         EXTENSION_MAPPING = qml=C++
0041 
0042 # Documenting types
0043 
0044 QML is partially-typed: functions are untyped, properties and signals are.
0045 Doxyqml provides a way to define types when they are missing or not precise
0046 enough.
0047 
0048 ## Functions
0049 
0050 Functions in QML are untyped, but you can define types in the documentation
0051 like this:
0052 
0053 ```qml
0054 /**
0055  * Create a user
0056  * @param type:string firstname User firstname
0057  * @param type:string lastname User lastname
0058  * @param type:int User age
0059  * @return type:User The User object
0060  */
0061 function createUser(firstname, lastname, age);
0062 ```
0063 
0064 ## Properties
0065 
0066 QML properties are typed, so Doxyqml uses them by default. You can nevertheless
0067 overwrite the type using the same `type:<name>` syntax. This is useful to
0068 document property aliases:
0069 
0070 ```qml
0071 /** type:string The user lastname */
0072 property alias lastname: someObject.text
0073 ```
0074 
0075 ## Signals
0076 
0077 QML signals are typed, so there is no need to use the `type:<name>` syntax to
0078 document their parameters. Using `type:<name>` syntax in signal documentation
0079 will not work: Doxyqml won't strip it out and Doxygen will confuse it with the
0080 parameter name.
0081 
0082 ```qml
0083 /**
0084  * User just logged in
0085  * @param user The user which logged in
0086  */
0087 signal loggedIn(User user)
0088 ```
0089 
0090 ## Extracting internal elements
0091 
0092 QML elements with an id are exported as private member variables. If you
0093 set the `EXTRACT_ALL` and `EXTRACT_PRIVATE` Doxygen keys to `YES`, then
0094 these elements will be visible in the generated documentation.