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
language Namespace Reference

Classes

class  _stackVariable
 
class  _string
 
class  closeQtConfig
 
class  endFunctionDefinition
 
struct  EnumLookup
 
struct  FormattingTraits
 
struct  FormattingTraits< Encoding::Unicode >
 
struct  FormattingTraits< Encoding::Utf8 >
 
class  openQtConfig
 
class  qtConfig
 
class  repeat
 
struct  SignalSlot
 
class  startFunctionDefinition1
 
class  StringViewStreamable
 

Typedefs

using charliteral = _string<false>
 
using qstring = _string<true>
 
using stackVariable = _stackVariable<false>
 
using stackVariableWithInitParameters = _stackVariable<true>
 

Enumerations

enum  : int { maxSegmentSize = 1024 }
 
enum class  OverloadUse { Always , WhenAmbiguousOrEmpty , Never }
 
enum class  Encoding { Utf8 , Unicode }
 
enum class  SignalSlotOption { Ambiguous = 0x1 }
 

Functions

Language language ()
 
void setLanguage (Language l)
 
QTextStreamoperator<< (QTextStream &str, const qtConfig &c)
 
QTextStreamoperator<< (QTextStream &str, const openQtConfig &c)
 
QTextStreamoperator<< (QTextStream &str, const closeQtConfig &c)
 
template<int N>
QLatin1StringView lookupEnum (const EnumLookup(&array)[N], int value, int defaultIndex=0)
 
QString fixClassName (QString className)
 
QLatin1StringView toolbarArea (int v)
 
QLatin1StringView sizePolicy (int v)
 
QLatin1StringView dockWidgetArea (int v)
 
QLatin1StringView paletteColorRole (int v)
 
static int formatEscapedNumber (QTextStream &str, ushort value, int base, int width, char prefix=0)
 
static int formatSpecialCharacter (QTextStream &str, ushort value)
 
template<Encoding e, class Iterator >
static void formatStringSequence (QTextStream &str, Iterator it, Iterator end, const QString &indent, int escapeIntegerBase, int escapeWidth, char escapePrefix=0)
 
void _formatString (QTextStream &str, const QString &value, const QString &indent, bool qString)
 
QTextStreamoperator<< (QTextStream &str, const repeat &r)
 
QTextStreamoperator<< (QTextStream &str, const startFunctionDefinition1 &f)
 
QTextStreamoperator<< (QTextStream &str, const endFunctionDefinition &f)
 
void _formatStackVariable (QTextStream &str, const char *className, QStringView varName, bool withInitParameters)
 
static bool isConstRef (const QStringView &arg)
 
static QString formatOverload (const QStringView &parameters)
 
static void formatMemberFnPtr (QTextStream &str, const SignalSlot &s, OverloadUse useQOverload)
 
static void formatMemberFnPtrConnection (QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver)
 
static void formatStringBasedConnection (QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver)
 
void formatConnection (QTextStream &str, const SignalSlot &sender, const SignalSlot &receiver, ConnectionSyntax connectionSyntax)
 
QString boolValue (bool v)
 
static QString dot ()
 
QString enumValue (const QString &value)
 
ConnectionSyntax connectionSyntax ()
 
void setConnectionSyntax (ConnectionSyntax cs)
 
template<bool AsQString>
QTextStreamoperator<< (QTextStream &str, const language::_string< AsQString > &s)
 
template<bool withInitParameters>
QTextStreamoperator<< (QTextStream &str, const _stackVariable< withInitParameters > &s)
 

Variables

static Encoding encoding = Encoding::Utf8
 
static Language _language = Language::Cpp
 
QString derefPointer
 
char listStart
 
char listEnd
 
QString nullPtr
 
QString operatorNew
 
QString qtQualifier
 
QString qualifier
 
QString self
 
QString eol
 
QString emptyString
 
QString cppQualifier = u"::"_s
 
QString cppTrue = u"true"_s
 
QString cppFalse = u"false"_s
 

Typedef Documentation

◆ charliteral

Definition at line 110 of file language.h.

◆ qstring

using language::qstring = _string<true>

Definition at line 111 of file language.h.

◆ stackVariable

Definition at line 173 of file language.h.

◆ stackVariableWithInitParameters

Definition at line 174 of file language.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : int
Enumerator
maxSegmentSize 

Definition at line 237 of file language.cpp.

◆ Encoding

enum class language::Encoding
strong
Enumerator
Utf8 
Unicode 

Definition at line 83 of file language.h.

◆ OverloadUse

enum class language::OverloadUse
strong
Enumerator
Always 
WhenAmbiguousOrEmpty 
Never 

Definition at line 374 of file language.cpp.

◆ SignalSlotOption

enum class language::SignalSlotOption
strong
Enumerator
Ambiguous 

Definition at line 176 of file language.h.

Function Documentation

◆ _formatStackVariable()

void language::_formatStackVariable ( QTextStream & str,
const char * className,
QStringView varName,
bool withInitParameters )

Definition at line 357 of file language.cpp.

References className, Cpp, language(), Python, and str.

Referenced by language::_stackVariable< withInitParameters >::format().

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

◆ _formatString()

void language::_formatString ( QTextStream & str,
const QString & value,
const QString & indent,
bool qString )

Definition at line 283 of file language.cpp.

References _language, QString::cbegin(), Cpp, encoding, str, Unicode, and Utf8.

Referenced by language::_string< AsQString >::format().

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

◆ boolValue()

QString language::boolValue ( bool v)

Definition at line 493 of file language.cpp.

References Cpp, cppFalse, cppTrue, language(), Python, and QStringLiteral.

+ Here is the call graph for this function:

◆ connectionSyntax()

ConnectionSyntax language::connectionSyntax ( )

Referenced by formatConnection().

+ Here is the caller graph for this function:

◆ dockWidgetArea()

QLatin1StringView language::dockWidgetArea ( int v)

Definition at line 139 of file language.cpp.

References lookupEnum().

Referenced by CPP::WriteInitialization::acceptWidget().

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

◆ dot()

static QString language::dot ( )
inlinestatic

Definition at line 504 of file language.cpp.

References QStringLiteral.

Referenced by enumValue().

+ Here is the caller graph for this function:

◆ enumValue()

QString language::enumValue ( const QString & value)

Definition at line 506 of file language.cpp.

References Cpp, cppQualifier, dot(), and language().

Referenced by CPP::WriteInitialization::acceptLayoutItem(), and CPP::WriteInitialization::acceptWidget().

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

◆ fixClassName()

QString language::fixClassName ( QString className)

Definition at line 103 of file language.cpp.

References className, cppQualifier, language(), and Python.

Referenced by Python::WriteDeclaration::acceptUI(), and CPP::WriteInitialization::acceptWidget().

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

◆ formatConnection()

void language::formatConnection ( QTextStream & str,
const SignalSlot & sender,
const SignalSlot & receiver,
ConnectionSyntax connectionSyntax )

Definition at line 459 of file language.cpp.

References Ambiguous, connectionSyntax(), QStringView::contains(), Cpp, formatMemberFnPtrConnection(), formatStringBasedConnection(), QString::indexOf(), QStringView::isEmpty(), language(), QString::left(), MemberFunctionPtr, QStringView::mid(), language::SignalSlot::name, language::SignalSlot::options, Python, language::SignalSlot::signature, str, and StringBased.

Referenced by CPP::WriteInitialization::acceptConnection().

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

◆ formatEscapedNumber()

static int language::formatEscapedNumber ( QTextStream & str,
ushort value,
int base,
int width,
char prefix = 0 )
static

Definition at line 185 of file language.cpp.

References base, and str.

Referenced by formatStringSequence().

+ Here is the caller graph for this function:

◆ formatMemberFnPtr()

static void language::formatMemberFnPtr ( QTextStream & str,
const SignalSlot & s,
OverloadUse useQOverload )
static

Definition at line 407 of file language.cpp.

References Always, Ambiguous, formatOverload(), QStringView::left(), QStringView::mid(), Never, Q_ASSERT, str, and WhenAmbiguousOrEmpty.

Referenced by formatMemberFnPtrConnection().

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

◆ formatMemberFnPtrConnection()

static void language::formatMemberFnPtrConnection ( QTextStream & str,
const SignalSlot & sender,
const SignalSlot & receiver )
static

Definition at line 440 of file language.cpp.

References formatMemberFnPtr(), language::SignalSlot::name, Never, str, and WhenAmbiguousOrEmpty.

Referenced by formatConnection().

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

◆ formatOverload()

static QString language::formatOverload ( const QStringView & parameters)
static

Definition at line 388 of file language.cpp.

References arg, args, QList< T >::at(), i, isConstRef(), QList< T >::size(), and QStringView::split().

Referenced by formatMemberFnPtr().

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

◆ formatSpecialCharacter()

static int language::formatSpecialCharacter ( QTextStream & str,
ushort value )
static

Definition at line 210 of file language.cpp.

References str.

Referenced by formatStringSequence().

+ Here is the caller graph for this function:

◆ formatStringBasedConnection()

static void language::formatStringBasedConnection ( QTextStream & str,
const SignalSlot & sender,
const SignalSlot & receiver )
static

Definition at line 451 of file language.cpp.

References language::SignalSlot::name, language::SignalSlot::signature, and str.

Referenced by formatConnection().

+ Here is the caller graph for this function:

◆ formatStringSequence()

template<Encoding e, class Iterator >
static void language::formatStringSequence ( QTextStream & str,
Iterator it,
Iterator end,
const QString & indent,
int escapeIntegerBase,
int escapeWidth,
char escapePrefix = 0 )
static

Definition at line 257 of file language.cpp.

References formatEscapedNumber(), formatSpecialCharacter(), it, maxSegmentSize, and str.

+ Here is the call graph for this function:

◆ isConstRef()

static bool language::isConstRef ( const QStringView & arg)
static

Definition at line 383 of file language.cpp.

References arg.

Referenced by formatOverload().

+ Here is the caller graph for this function:

◆ language()

Language language::language ( )

Definition at line 16 of file language.cpp.

References _language.

Referenced by _formatStackVariable(), CPP::WriteInitialization::acceptUI(), CPP::WriteInitialization::acceptWidget(), boolValue(), enumValue(), fixClassName(), formatConnection(), and Uic::write().

+ Here is the caller graph for this function:

◆ lookupEnum()

template<int N>
QLatin1StringView language::lookupEnum ( const EnumLookup(&) array[N],
int value,
int defaultIndex = 0 )

Definition at line 91 of file language.cpp.

References defaultIndex(), i, and qWarning.

Referenced by dockWidgetArea(), paletteColorRole(), sizePolicy(), and toolbarArea().

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

◆ operator<<() [1/8]

template<bool withInitParameters>
QTextStream & language::operator<< ( QTextStream & str,
const _stackVariable< withInitParameters > & s )
inline

Definition at line 167 of file language.h.

References str.

◆ operator<<() [2/8]

QTextStream & language::operator<< ( QTextStream & str,
const closeQtConfig & c )

Definition at line 78 of file language.cpp.

References str.

◆ operator<<() [3/8]

QTextStream & language::operator<< ( QTextStream & str,
const endFunctionDefinition & f )

Definition at line 344 of file language.cpp.

◆ operator<<() [4/8]

template<bool AsQString>
QTextStream & language::operator<< ( QTextStream & str,
const language::_string< AsQString > & s )
inline

Definition at line 104 of file language.h.

References str.

◆ operator<<() [5/8]

QTextStream & language::operator<< ( QTextStream & str,
const openQtConfig & c )

Definition at line 72 of file language.cpp.

References str.

◆ operator<<() [6/8]

QTextStream & language::operator<< ( QTextStream & str,
const qtConfig & c )

Definition at line 66 of file language.cpp.

References str.

◆ operator<<() [7/8]

QTextStream & language::operator<< ( QTextStream & str,
const repeat & r )

Definition at line 307 of file language.cpp.

◆ operator<<() [8/8]

QTextStream & language::operator<< ( QTextStream & str,
const startFunctionDefinition1 & f )

Definition at line 323 of file language.cpp.

◆ paletteColorRole()

QLatin1StringView language::paletteColorRole ( int v)

Definition at line 153 of file language.cpp.

References lookupEnum().

+ Here is the call graph for this function:

◆ setConnectionSyntax()

void language::setConnectionSyntax ( ConnectionSyntax cs)

◆ setLanguage()

void language::setLanguage ( Language l)

Definition at line 18 of file language.cpp.

References _language, Cpp, derefPointer, emptyString, encoding, eol, listEnd, listStart, nullPtr, operatorNew, Python, qtQualifier, qualifier, self, Unicode, and Utf8.

Referenced by runUic().

+ Here is the caller graph for this function:

◆ sizePolicy()

QLatin1StringView language::sizePolicy ( int v)

Definition at line 124 of file language.cpp.

References lookupEnum().

+ Here is the call graph for this function:

◆ toolbarArea()

QLatin1StringView language::toolbarArea ( int v)

Definition at line 110 of file language.cpp.

References lookupEnum().

+ Here is the call graph for this function:

Variable Documentation

◆ _language

Language language::_language = Language::Cpp
static

Definition at line 14 of file language.cpp.

Referenced by _formatString(), language(), and setLanguage().

◆ cppFalse

QString language::cppFalse = u"false"_s

Definition at line 64 of file language.cpp.

Referenced by boolValue().

◆ cppQualifier

QString language::cppQualifier = u"::"_s

Definition at line 62 of file language.cpp.

Referenced by enumValue(), and fixClassName().

◆ cppTrue

QString language::cppTrue = u"true"_s

Definition at line 63 of file language.cpp.

Referenced by boolValue().

◆ derefPointer

◆ emptyString

QString language::emptyString

Definition at line 60 of file language.cpp.

Referenced by CPP::WriteInitialization::acceptWidget(), and setLanguage().

◆ encoding

Encoding language::encoding = Encoding::Utf8
static

Definition at line 13 of file language.cpp.

Referenced by _formatString(), and setLanguage().

◆ eol

◆ listEnd

char language::listEnd

Definition at line 53 of file language.cpp.

Referenced by setLanguage().

◆ listStart

char language::listStart

Definition at line 52 of file language.cpp.

Referenced by setLanguage().

◆ nullPtr

QString language::nullPtr

Definition at line 54 of file language.cpp.

Referenced by setLanguage().

◆ operatorNew

◆ qtQualifier

QString language::qtQualifier

Definition at line 56 of file language.cpp.

Referenced by setLanguage().

◆ qualifier

◆ self

QString language::self

Definition at line 58 of file language.cpp.

Referenced by CPP::WriteInitialization::acceptUI(), and setLanguage().