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
QQmlFormatOptions Class Reference

#include <qqmlformatoptions_p.h>

+ Collaboration diagram for QQmlFormatOptions:

Public Types

enum  Settings {
  UseTabs = 0 , IndentWidth , MaxColumnWidth , NormalizeOrder ,
  NewlineType , ObjectsSpacing , FunctionsSpacing , SortImports ,
  SettingsCount
}
 
using LineEndings = QQmlJS::Dom::LineWriterOptions::LineEndings
 
using AttributesSequence = QQmlJS::Dom::LineWriterOptions::AttributesSequence
 

Public Member Functions

 QQmlFormatOptions ()
 
bool tabsEnabled () const
 
void setTabsEnabled (bool tabs)
 
bool normalizeEnabled () const
 
void setNormalizeEnabled (bool normalize)
 
bool objectsSpacing () const
 
void setObjectsSpacing (bool spacing)
 
bool functionsSpacing () const
 
void setFunctionsSpacing (bool spacing)
 
bool sortImports () const
 
void setSortImports (bool sort)
 
int indentWidth () const
 
void setIndentWidth (int width)
 
int maxColumnWidth () const
 
void setMaxColumnWidth (int width)
 
bool isMaxColumnWidthSet () const
 
QQmlJS::Dom::LineWriterOptions optionsForCode (const QString &code) const
 
QQmlFormatOptionLineEndings newline () const
 
void setNewline (const QQmlFormatOptionLineEndings &endings)
 
QStringList files () const
 
void setFiles (const QStringList &newFiles)
 
QStringList arguments () const
 
void setArguments (const QStringList &newArguments)
 
bool isVerbose () const
 
void setIsVerbose (bool newVerbose)
 
bool isValid () const
 
bool isInplace () const
 
void setIsInplace (bool newInplace)
 
bool forceEnabled () const
 
void setForceEnabled (bool newForce)
 
bool ignoreSettingsEnabled () const
 
void setIgnoreSettingsEnabled (bool newIgnoreSettings)
 
bool writeDefaultSettingsEnabled () const
 
void setWriteDefaultSettingsEnabled (bool newWriteDefaultSettings)
 
bool indentWidthSet () const
 
void setIndentWidthSet (bool newIndentWidthSet)
 
QStringList errors () const
 
void addError (const QString &newError)
 
void applySettings (const QQmlFormatSettings &settings)
 
QQmlFormatOptions optionsForFile (const QString &fileName, QQmlFormatSettings *settings) const
 

Static Public Member Functions

static LineEndings detectLineEndings (const QString &code)
 
static LineEndings lineEndings (QQmlFormatOptionLineEndings endings, const QString &code)
 
static QQmlFormatOptionLineEndings parseEndings (const QString &endings)
 
static QQmlFormatOptions buildCommandLineOptions (const QStringList &args)
 

Detailed Description

Definition at line 35 of file qqmlformatoptions_p.h.

Member Typedef Documentation

◆ AttributesSequence

◆ LineEndings

Member Enumeration Documentation

◆ Settings

Enumerator
UseTabs 
IndentWidth 
MaxColumnWidth 
NormalizeOrder 
NewlineType 
ObjectsSpacing 
FunctionsSpacing 
SortImports 
SettingsCount 

Definition at line 128 of file qqmlformatoptions_p.h.

Constructor & Destructor Documentation

◆ QQmlFormatOptions()

QQmlFormatOptions::QQmlFormatOptions ( )

Definition at line 12 of file qqmlformatoptions.cpp.

References setFunctionsSpacing(), setIndentWidth(), setNormalizeEnabled(), setObjectsSpacing(), and setTabsEnabled().

+ Here is the call graph for this function:

Member Function Documentation

◆ addError()

void QQmlFormatOptions::addError ( const QString & newError)
inline

Definition at line 120 of file qqmlformatoptions_p.h.

◆ applySettings()

void QQmlFormatOptions::applySettings ( const QQmlFormatSettings & settings)

Definition at line 69 of file qqmlformatoptions.cpp.

References FunctionsSpacing, IndentWidth, MaxColumnWidth, NewlineType, NormalizeOrder, ObjectsSpacing, setFunctionsSpacing(), setIndentWidth(), setMaxColumnWidth(), setNormalizeEnabled(), setObjectsSpacing(), setSortImports(), setTabsEnabled(), SortImports, and UseTabs.

Referenced by optionsForFile().

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

◆ arguments()

QStringList QQmlFormatOptions::arguments ( ) const
inline

Definition at line 100 of file qqmlformatoptions_p.h.

◆ buildCommandLineOptions()

QQmlFormatOptions QQmlFormatOptions::buildCommandLineOptions ( const QStringList & args)
static

Definition at line 113 of file qqmlformatoptions.cpp.

References FunctionsSpacing, IndentWidth, MaxColumnWidth, NewlineType, NormalizeOrder, ObjectsSpacing, setFunctionsSpacing(), setIndentWidth(), setMaxColumnWidth(), setNormalizeEnabled(), setObjectsSpacing(), setSortImports(), setTabsEnabled(), setWriteDefaultSettingsEnabled(), SortImports, and UseTabs.

+ Here is the call graph for this function:

◆ detectLineEndings()

QQmlFormatOptions::LineEndings QQmlFormatOptions::detectLineEndings ( const QString & code)
static

Definition at line 21 of file qqmlformatoptions.cpp.

◆ errors()

QStringList QQmlFormatOptions::errors ( ) const
inline

Definition at line 119 of file qqmlformatoptions_p.h.

◆ files()

QStringList QQmlFormatOptions::files ( ) const
inline

Definition at line 98 of file qqmlformatoptions_p.h.

◆ forceEnabled()

bool QQmlFormatOptions::forceEnabled ( ) const
inline

Definition at line 107 of file qqmlformatoptions_p.h.

◆ functionsSpacing()

bool QQmlFormatOptions::functionsSpacing ( ) const
inline

Definition at line 73 of file qqmlformatoptions_p.h.

◆ ignoreSettingsEnabled()

bool QQmlFormatOptions::ignoreSettingsEnabled ( ) const
inline

Definition at line 109 of file qqmlformatoptions_p.h.

Referenced by optionsForFile().

+ Here is the caller graph for this function:

◆ indentWidth()

int QQmlFormatOptions::indentWidth ( ) const
inline

Definition at line 79 of file qqmlformatoptions_p.h.

◆ indentWidthSet()

bool QQmlFormatOptions::indentWidthSet ( ) const
inline

Definition at line 117 of file qqmlformatoptions_p.h.

◆ isInplace()

bool QQmlFormatOptions::isInplace ( ) const
inline

Definition at line 105 of file qqmlformatoptions_p.h.

◆ isMaxColumnWidthSet()

bool QQmlFormatOptions::isMaxColumnWidthSet ( ) const
inline

Definition at line 84 of file qqmlformatoptions_p.h.

◆ isValid()

bool QQmlFormatOptions::isValid ( ) const
inline

Definition at line 104 of file qqmlformatoptions_p.h.

◆ isVerbose()

bool QQmlFormatOptions::isVerbose ( ) const
inline

Definition at line 102 of file qqmlformatoptions_p.h.

◆ lineEndings()

static LineEndings QQmlFormatOptions::lineEndings ( QQmlFormatOptionLineEndings endings,
const QString & code )
inlinestatic

Definition at line 45 of file qqmlformatoptions_p.h.

◆ maxColumnWidth()

int QQmlFormatOptions::maxColumnWidth ( ) const
inline

Definition at line 82 of file qqmlformatoptions_p.h.

◆ newline()

QQmlFormatOptionLineEndings QQmlFormatOptions::newline ( ) const
inline

Definition at line 95 of file qqmlformatoptions_p.h.

◆ normalizeEnabled()

bool QQmlFormatOptions::normalizeEnabled ( ) const
inline

Definition at line 62 of file qqmlformatoptions_p.h.

◆ objectsSpacing()

bool QQmlFormatOptions::objectsSpacing ( ) const
inline

Definition at line 71 of file qqmlformatoptions_p.h.

◆ optionsForCode()

QQmlJS::Dom::LineWriterOptions QQmlFormatOptions::optionsForCode ( const QString & code) const
inline

Definition at line 86 of file qqmlformatoptions_p.h.

◆ optionsForFile()

QQmlFormatOptions QQmlFormatOptions::optionsForFile ( const QString & fileName,
QQmlFormatSettings * settings ) const

Definition at line 296 of file qqmlformatoptions.cpp.

References applySettings(), ignoreSettingsEnabled(), and setIsInplace().

+ Here is the call graph for this function:

◆ parseEndings()

QQmlFormatOptionLineEndings QQmlFormatOptions::parseEndings ( const QString & endings)
static

Definition at line 50 of file qqmlformatoptions.cpp.

◆ setArguments()

void QQmlFormatOptions::setArguments ( const QStringList & newArguments)
inline

Definition at line 101 of file qqmlformatoptions_p.h.

◆ setFiles()

void QQmlFormatOptions::setFiles ( const QStringList & newFiles)
inline

Definition at line 99 of file qqmlformatoptions_p.h.

◆ setForceEnabled()

void QQmlFormatOptions::setForceEnabled ( bool newForce)
inline

Definition at line 108 of file qqmlformatoptions_p.h.

◆ setFunctionsSpacing()

void QQmlFormatOptions::setFunctionsSpacing ( bool spacing)
inline

Definition at line 74 of file qqmlformatoptions_p.h.

Referenced by QQmlFormatOptions(), applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setIgnoreSettingsEnabled()

void QQmlFormatOptions::setIgnoreSettingsEnabled ( bool newIgnoreSettings)
inline

Definition at line 110 of file qqmlformatoptions_p.h.

◆ setIndentWidth()

void QQmlFormatOptions::setIndentWidth ( int width)
inline

Definition at line 80 of file qqmlformatoptions_p.h.

Referenced by QQmlFormatOptions(), applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setIndentWidthSet()

void QQmlFormatOptions::setIndentWidthSet ( bool newIndentWidthSet)
inline

Definition at line 118 of file qqmlformatoptions_p.h.

◆ setIsInplace()

void QQmlFormatOptions::setIsInplace ( bool newInplace)
inline

Definition at line 106 of file qqmlformatoptions_p.h.

Referenced by optionsForFile().

+ Here is the caller graph for this function:

◆ setIsVerbose()

void QQmlFormatOptions::setIsVerbose ( bool newVerbose)
inline

Definition at line 103 of file qqmlformatoptions_p.h.

◆ setMaxColumnWidth()

void QQmlFormatOptions::setMaxColumnWidth ( int width)
inline

Definition at line 83 of file qqmlformatoptions_p.h.

Referenced by applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setNewline()

void QQmlFormatOptions::setNewline ( const QQmlFormatOptionLineEndings & endings)
inline

Definition at line 96 of file qqmlformatoptions_p.h.

◆ setNormalizeEnabled()

void QQmlFormatOptions::setNormalizeEnabled ( bool normalize)
inline

Definition at line 66 of file qqmlformatoptions_p.h.

Referenced by QQmlFormatOptions(), applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setObjectsSpacing()

void QQmlFormatOptions::setObjectsSpacing ( bool spacing)
inline

Definition at line 72 of file qqmlformatoptions_p.h.

Referenced by QQmlFormatOptions(), applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setSortImports()

void QQmlFormatOptions::setSortImports ( bool sort)
inline

Definition at line 77 of file qqmlformatoptions_p.h.

Referenced by applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setTabsEnabled()

void QQmlFormatOptions::setTabsEnabled ( bool tabs)
inline

Definition at line 61 of file qqmlformatoptions_p.h.

Referenced by QQmlFormatOptions(), applySettings(), and buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ setWriteDefaultSettingsEnabled()

void QQmlFormatOptions::setWriteDefaultSettingsEnabled ( bool newWriteDefaultSettings)
inline

Definition at line 112 of file qqmlformatoptions_p.h.

Referenced by buildCommandLineOptions().

+ Here is the caller graph for this function:

◆ sortImports()

bool QQmlFormatOptions::sortImports ( ) const
inline

Definition at line 76 of file qqmlformatoptions_p.h.

◆ tabsEnabled()

bool QQmlFormatOptions::tabsEnabled ( ) const
inline

Definition at line 60 of file qqmlformatoptions_p.h.

◆ writeDefaultSettingsEnabled()

bool QQmlFormatOptions::writeDefaultSettingsEnabled ( ) const
inline

Definition at line 111 of file qqmlformatoptions_p.h.


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