![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The Parameter class describes one function parameter. More...
#include <parameter.h>
Public Member Functions | |
| Parameter ()=default | |
| Parameter (QString type, QString name=QString(), QString defaultValue=QString()) | |
| void | setName (const QString &name) |
| bool | hasType () const |
| const QString & | type () const |
| const QString & | name () const |
| const QString & | defaultValue () const |
| void | setDefaultValue (const QString &t) |
| void | set (const QString &type, const QString &name, const QString &defaultValue=QString()) |
| QString | signature (bool includeValue=false) const |
| Reconstructs the text signature for the parameter and returns it. | |
| qsizetype | nameInsertionPoint () const |
| Returns the position within the type string where the parameter name should be inserted, or -1 if the name belongs at the end. | |
| const QString & | canonicalType () const |
| void | setCanonicalType (const QString &t) |
The Parameter class describes one function parameter.
A parameter can be a function parameter or a macro parameter. It has a name, a data type, and an optional default value. These are all stored as strings so they can be compared with a parameter in a function signature to find a match.
Definition at line 13 of file parameter.h.
|
default |
|
inlineexplicit |
Definition at line 17 of file parameter.h.
References Parameter().
Referenced by Parameter().
|
inlinenodiscard |
Definition at line 39 of file parameter.h.
|
inlinenodiscard |
Definition at line 26 of file parameter.h.
|
inlinenodiscard |
Definition at line 23 of file parameter.h.
|
inlinenodiscard |
Definition at line 25 of file parameter.h.
|
nodiscard |
Returns the position within the type string where the parameter name should be inserted, or -1 if the name belongs at the end.
For types with inside-out declarator syntax (such as references to arrays, pointers to functions, or pointers to members), the parameter name must be inserted inside the type rather than appended after it. Clang produces types like "const char (&)[Size]" or "void (Cls::*)(int)" where the name belongs before the closing paren: "const char (&data)[Size]", "void (Cls::*cb)(int)".
Definition at line 38 of file parameter.cpp.
|
inline |
Definition at line 29 of file parameter.h.
Definition at line 40 of file parameter.h.
Definition at line 27 of file parameter.h.
Definition at line 22 of file parameter.h.
|
nodiscard |
Reconstructs the text signature for the parameter and returns it.
If includeValue is true and there is a default value, the default value is appended with '='.
Definition at line 53 of file parameter.cpp.
|
inlinenodiscard |
Definition at line 24 of file parameter.h.