Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
Parameter Class Reference

The Parameter class describes one function parameter. More...

#include <parameters.h>

+ Collaboration diagram for Parameter:

Public Member Functions

 Parameter ()=default
 
 Parameter (QString type, QString name=QString(), QString defaultValue=QString())
 
void setName (const QString &name)
 
bool hasType () const
 
const QStringtype () const
 
const QStringname () const
 
const QStringdefaultValue () 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.
 
const QStringcanonicalType () const
 
void setCanonicalType (const QString &t)
 

Public Attributes

QString m_canonicalType {}
 
QString m_type {}
 
QString m_name {}
 
QString m_defaultValue {}
 

Detailed Description

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 19 of file parameters.h.

Constructor & Destructor Documentation

◆ Parameter() [1/2]

Parameter::Parameter ( )
default

◆ Parameter() [2/2]

Parameter::Parameter ( QString type,
QString name = QString(),
QString defaultValue = QString() )
inlineexplicit

Definition at line 23 of file parameters.h.

References Parameter().

Referenced by Parameter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ canonicalType()

const QString & Parameter::canonicalType ( ) const
inlinenodiscard

Definition at line 44 of file parameters.h.

◆ defaultValue()

const QString & Parameter::defaultValue ( ) const
inlinenodiscard

Definition at line 32 of file parameters.h.

◆ hasType()

bool Parameter::hasType ( ) const
inlinenodiscard

Definition at line 29 of file parameters.h.

◆ name()

const QString & Parameter::name ( ) const
inlinenodiscard

Definition at line 31 of file parameters.h.

Referenced by testing.tools.encode_pdf_filter._PdfStream::RegisterByName().

+ Here is the caller graph for this function:

◆ set()

void Parameter::set ( const QString & type,
const QString & name,
const QString & defaultValue = QString() )
inline

Definition at line 35 of file parameters.h.

◆ setCanonicalType()

void Parameter::setCanonicalType ( const QString & t)
inline

Definition at line 45 of file parameters.h.

◆ setDefaultValue()

void Parameter::setDefaultValue ( const QString & t)
inline

Definition at line 33 of file parameters.h.

◆ setName()

void Parameter::setName ( const QString & name)
inline

Definition at line 28 of file parameters.h.

◆ signature()

QString Parameter::signature ( bool includeValue = false) const
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 36 of file parameters.cpp.

◆ type()

const QString & Parameter::type ( ) const
inlinenodiscard

Definition at line 30 of file parameters.h.

Member Data Documentation

◆ m_canonicalType

QString Parameter::m_canonicalType {}

Definition at line 48 of file parameters.h.

◆ m_defaultValue

QString Parameter::m_defaultValue {}

Definition at line 51 of file parameters.h.

◆ m_name

QString Parameter::m_name {}

Definition at line 50 of file parameters.h.

◆ m_type

QString Parameter::m_type {}

Definition at line 49 of file parameters.h.


The documentation for this class was generated from the following files: