Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlsignalnames.cpp File Reference

(2fc19f2c627802d26bd385a6c9cc1f6412852ee2)

#include "qqmlsignalnames_p.h"
#include <iterator>
#include <algorithm>
#include <optional>
#include <string>
+ Include dependency graph for qqmlsignalnames.cpp:

Go to the source code of this file.

Enumerations

enum  ChangeCase { ToUpper , ToLower }
 
enum  HandlerType { ChangedHandler , Handler }
 

Functions

static constexpr const QLatin1String On ("on")
 
static constexpr const QLatin1String Changed ("Changed")
 
static std::optional< qsizetypefirstLetterIdx (QStringView name, qsizetype removePrefix=0, qsizetype removeSuffix=0)
 
static std::optional< QCharfirstLetter (QStringView name, qsizetype removePrefix=0, qsizetype removeSuffix=0)
 
static void changeCaseOfFirstLetter (QString &name, ChangeCase option, qsizetype removePrefix=0, qsizetype removeSuffix=0)
 
static std::optional< QStringtoQStringData (std::optional< QStringView > view)
 
static QByteArray toUtf8Data (QUtf8StringView view)
 
static std::optional< QByteArraytoUtf8Data (std::optional< QUtf8StringView > view)
 
template<typename View >
std::optional< ViewchangedSignalNameToPropertyNameTemplate (View changeSignal)
 
template<HandlerType type>
static std::optional< QStringhandlerNameToSignalNameHelper (QStringView handler)
 

Variables

static constexpr const qsizetype StrlenOn = On.length()
 
static constexpr const qsizetype StrlenChanged = Changed.length()
 

Enumeration Type Documentation

◆ ChangeCase

enum ChangeCase
Enumerator
ToUpper 
ToLower 

Definition at line 40 of file qqmlsignalnames.cpp.

◆ HandlerType

Enumerator
ChangedHandler 
Handler 

Definition at line 167 of file qqmlsignalnames.cpp.

Function Documentation

◆ changeCaseOfFirstLetter()

static void changeCaseOfFirstLetter ( QString & name,
ChangeCase option,
qsizetype removePrefix = 0,
qsizetype removeSuffix = 0 )
static

Definition at line 41 of file qqmlsignalnames.cpp.

References firstLetterIdx(), and ToUpper.

Referenced by QQmlSignalNames::addPrefixToPropertyName(), handlerNameToSignalNameHelper(), and QQmlSignalNames::signalNameToHandlerName().

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

◆ Changed()

static constexpr const QLatin1String Changed ( "Changed" )
staticconstexpr

Referenced by changedSignalNameToPropertyNameTemplate(), QQmlSignalNames::isChangedHandlerName(), QQmlSignalNames::isChangedSignalName(), QQmlSignalNames::propertyNameToChangedSignalName(), and QQmlSignalNames::propertyNameToChangedSignalName().

+ Here is the caller graph for this function:

◆ changedSignalNameToPropertyNameTemplate()

template<typename View >
std::optional< View > changedSignalNameToPropertyNameTemplate ( View changeSignal)

Definition at line 107 of file qqmlsignalnames.cpp.

References Changed(), and StrlenChanged.

Referenced by QQmlSignalNames::changedSignalNameToPropertyName(), and QQmlSignalNames::changedSignalNameToPropertyName().

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

◆ firstLetter()

static std::optional< QChar > firstLetter ( QStringView name,
qsizetype removePrefix = 0,
qsizetype removeSuffix = 0 )
static

Definition at line 32 of file qqmlsignalnames.cpp.

References firstLetterIdx().

Referenced by QQmlSignalNames::isChangedHandlerName(), QQmlSignalNames::isChangedSignalName(), and QQmlSignalNames::isHandlerName().

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

◆ firstLetterIdx()

static std::optional< qsizetype > firstLetterIdx ( QStringView name,
qsizetype removePrefix = 0,
qsizetype removeSuffix = 0 )
static

Definition at line 20 of file qqmlsignalnames.cpp.

Referenced by changeCaseOfFirstLetter(), and firstLetter().

+ Here is the caller graph for this function:

◆ handlerNameToSignalNameHelper()

template<HandlerType type>
static std::optional< QString > handlerNameToSignalNameHelper ( QStringView handler)
static

Definition at line 170 of file qqmlsignalnames.cpp.

References changeCaseOfFirstLetter(), ChangedHandler, QQmlSignalNames::isHandlerName(), Q_ASSERT, QStringView::sliced(), StrlenChanged, StrlenOn, and ToLower.

+ Here is the call graph for this function:

◆ On()

static constexpr const QLatin1String On ( "on" )
staticconstexpr

◆ toQStringData()

static std::optional< QString > toQStringData ( std::optional< QStringView > view)
static

Definition at line 52 of file qqmlsignalnames.cpp.

References view.

Referenced by QQmlSignalNames::changedSignalNameToPropertyName().

+ Here is the caller graph for this function:

◆ toUtf8Data() [1/2]

static QByteArray toUtf8Data ( QUtf8StringView view)
static

Definition at line 59 of file qqmlsignalnames.cpp.

References QByteArray(), and view.

Referenced by QQmlSignalNames::changedSignalNameToPropertyName(), QQmlSignalNames::propertyNameToChangedSignalName(), and toUtf8Data().

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

◆ toUtf8Data() [2/2]

static std::optional< QByteArray > toUtf8Data ( std::optional< QUtf8StringView > view)
static

Definition at line 64 of file qqmlsignalnames.cpp.

References toUtf8Data(), and view.

+ Here is the call graph for this function:

Variable Documentation

◆ StrlenChanged

◆ StrlenOn