QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
QET Namespace Reference

Namespaces

namespace  Icons
 
namespace  QetMessageBox
 

Enumerations

enum  GraphicsItemState { GIOK , GIBuildingFromXml , GILoadingFromXml }
 
enum  DepthOption { BringForward , Raise , Lower , SendBackward }
 List the various kind of changes for the zValue. More...
 
enum  OrientedMovement {
  ToNorth , ToNorthEast , ToEast , ToSouthEast ,
  ToSouth , ToSouthWest , ToWest , ToNorthWest
}
 Oriented movements. More...
 
enum  OperationAreas {
  ChangeInnerPoints = -4 , RotateArea = -3 , MoveArea = -2 , NoOperation = -1 ,
  ResizeFromTopLeftCorner = 0 , ResizeFromTopCenterCorner = 1 , ResizeFromTopRightCorner = 2 , ResizeFromMiddleLeftCorner = 3 ,
  ResizeFromMiddleRightCorner = 4 , ResizeFromBottomLeftCorner = 5 , ResizeFromBottomCenterCorner = 6 , ResizeFromBottomRightCorner = 7
}
 List areas related to some common operations. More...
 
enum  ScalingMethod { FreeScaling , SnapScalingPointToGrid , RoundScaleRatios }
 Supported types of interactive scaling, typically for a single element primitive. More...
 
enum  ConductorSegmentType { Horizontal = 1 , Vertical = 2 , Both = 3 }
 Known kinds of conductor segments. More...
 
enum  ItemType {
  Element = 1 , ElementsCategory = 2 , ElementsCollection = 4 , ElementsContainer = 6 ,
  ElementsCollectionItem = 7 , TitleBlockTemplate = 8 , TitleBlockTemplatesCollection = 16 , TitleBlockTemplatesCollectionItem = 24 ,
  Diagram = 32 , Project = 64 , All = 127
}
 
enum  Filtering { BeginFilter , RegularFilter , EndFilter }
 
enum  Action {
  Retry , Ignore , Erase , Abort ,
  Managed , Rename
}
 
enum  DiagramArea { BorderArea , ElementsArea }
 
enum  TitleBlockColumnLength { Absolute , RelativeToTotalLength , RelativeToRemainingLength }
 enum used to specify the type of a length More...
 
enum  QetCollection { Common , Company , Custom , Embedded }
 Enum used to specify the origin of a collection of thing (title block, element etc...) More...
 

Functions

QString license ()
 
QString qetCollectionToString (const QetCollection &c)
 QET::qetCollectionToString.
 
QetCollection qetCollectionFromString (const QString &str)
 QET::qetCollectionFromString.
 
bool lineContainsPoint (const QLineF &, const QPointF &)
 
bool orthogonalProjection (const QPointF &, const QLineF &, QPointF *=nullptr)
 
bool attributeIsAnInteger (const QDomElement &, const QString &, int *=nullptr)
 
bool attributeIsAReal (const QDomElement &, const QString &, qreal *=nullptr)
 
QString ElementsAndConductorsSentence (int elements=0, int conductors=0, int indi_texts=0, int images=0, int shapes=0, int element_text=0, int tables_count=0, int terminal_strip_count=0)
 QET::ElementsAndConductorsSentence Permet de composer rapidement la proposition "x elements et y conducteurs" ou encore "x elements, y conducteurs et z champs de texte".
 
QList< QDomElement > findInDomElement (const QDomElement &, const QString &)
 
QList< QDomElement > findInDomElement (const QDomElement &, const QString &, const QString &)
 
QList< QChar > forbiddenCharacters ()
 
QString stringToFileName (const QString &)
 
QString escapeSpaces (const QString &)
 
QString unescapeSpaces (const QString &)
 
QString joinWithSpaces (const QStringList &)
 
QStringList splitWithSpaces (const QString &)
 
QString diagramAreaToString (const QET::DiagramArea &)
 
QET::DiagramArea diagramAreaFromString (const QString &)
 
qreal round (qreal, qreal)
 
qreal correctAngle (const qreal &, const bool &positive=false)
 
bool compareCanonicalFilePaths (const QString &, const QString &)
 
bool writeXmlFile (QDomDocument &xml_doc, const QString &filepath, QString *error_message=nullptr)
 
bool writeToFile (QDomDocument &xml_doc, QFile *file, QString *error_message=nullptr)
 
bool eachStrIsEqual (const QStringList &qsl)
 QET::eachStrIsEqual.
 
QActionGroup * depthActionGroup (QObject *parent=nullptr)
 QET::depthActionGroup.
 

Detailed Description

This file provides useful functions and enums that may be used from anywhere else within the QElectroTech application.

This namespace is meant to declare icons used within the QElectroTech application.

Enumeration Type Documentation

◆ Action

This enums lists the various ways to handle a standard problem when copying or moving element items (collections, categories, elements).

See also
MoveElementsHandler
Enumerator
Retry 

The operation must be tried again.

Ignore 

Skip the current item.

Erase 

Erase the target content.

Abort 

abort the whole operation, ignoring the current item

Managed 

the current item was handled by the Strategy object: do not treat it and continue

Rename 

the target has to be renamed

◆ ConductorSegmentType

Known kinds of conductor segments.

Enumerator
Horizontal 

Horizontal segment.

Vertical 

Vertical segment.

Both 

Invalid segment.

◆ DepthOption

List the various kind of changes for the zValue.

Enumerator
BringForward 

Bring item to the foreground so they have the highest zValue.

Raise 

Raise item one layer above their current one; zValues are incremented.

Lower 

Send item one layer below their current one; zValues are decremented.

SendBackward 

Send item to the background so they have the lowest zValue.

◆ DiagramArea

This enum represents diagram areas that may be exported/printed.

Enumerator
BorderArea 

Export the diagram along with its border and title block.

ElementsArea 

Export the content of the diagram only.

◆ Filtering

This enum represents the various steps when applying a filter.

Enumerator
BeginFilter 
RegularFilter 
EndFilter 

◆ GraphicsItemState

Enumerator
GIOK 

General state.

GIBuildingFromXml 

Item is currently building from a xml description (element)

GILoadingFromXml 

Item is loading her properties from a xml description.

◆ ItemType

This enums lists the various kind of items users can manage within the application.

Enumerator
Element 
ElementsCategory 
ElementsCollection 
ElementsContainer 
ElementsCollectionItem 
TitleBlockTemplate 
TitleBlockTemplatesCollection 
TitleBlockTemplatesCollectionItem 
Diagram 
Project 
All 

◆ OperationAreas

List areas related to some common operations.

Enumerator
ChangeInnerPoints 
RotateArea 
MoveArea 
NoOperation 
ResizeFromTopLeftCorner 
ResizeFromTopCenterCorner 
ResizeFromTopRightCorner 
ResizeFromMiddleLeftCorner 
ResizeFromMiddleRightCorner 
ResizeFromBottomLeftCorner 
ResizeFromBottomCenterCorner 
ResizeFromBottomRightCorner 

◆ OrientedMovement

Oriented movements.

Enumerator
ToNorth 
ToNorthEast 
ToEast 
ToSouthEast 
ToSouth 
ToSouthWest 
ToWest 
ToNorthWest 

◆ QetCollection

Enum used to specify the origin of a collection of thing (title block, element etc...)

Enumerator
Common 

From common collection.

Company 

From company collection.

Custom 

From user collection.

Embedded 

From an embedded collection (a project for example)

◆ ScalingMethod

Supported types of interactive scaling, typically for a single element primitive.

Enumerator
FreeScaling 

do not interfere with the default scaling process

SnapScalingPointToGrid 

snap the point used to define the new bounding rectangle to the grid

RoundScaleRatios 

adjust the scaling movement so that the induced scaling ratios are rounded

◆ TitleBlockColumnLength

enum used to specify the type of a length

Enumerator
Absolute 

the length is absolute and should be applied as is

RelativeToTotalLength 

the length is just a fraction of the total available length

RelativeToRemainingLength 

the length is just a fraction of the length that is still available when other types of lengths have been removed

Function Documentation

◆ attributeIsAnInteger()

bool QET::attributeIsAnInteger ( const QDomElement &  e,
const QString &  nom_attribut,
int *  entier = nullptr 
)

Permet de savoir si l'attribut nom_attribut d'un element XML e est bien un entier. Si oui, sa valeur est copiee dans entier.

Parameters
eElement XML
nom_attributNom de l'attribut a analyser
entierPointeur facultatif vers un entier
Returns
true si l'attribut est bien un entier, false sinon
Here is the caller graph for this function:

◆ attributeIsAReal()

bool QET::attributeIsAReal ( const QDomElement &  e,
const QString &  nom_attribut,
qreal *  reel = nullptr 
)

Permet de savoir si l'attribut nom_attribut d'un element XML e est bien un reel. Si oui, sa valeur est copiee dans reel.

Parameters
eElement XML
nom_attributNom de l'attribut a analyser
reelPointeur facultatif vers un double
Returns
true si l'attribut est bien un reel, false sinon
Here is the caller graph for this function:

◆ compareCanonicalFilePaths()

bool QET::compareCanonicalFilePaths ( const QString &  first,
const QString &  second 
)
Parameters
firstUn premier chemin vers un fichier
secondUn second chemin vers un fichier
Returns
true si les deux chemins existent existent et sont identiques lorsqu'ils sont exprimes sous forme canonique
Here is the caller graph for this function:

◆ correctAngle()

qreal QET::correctAngle ( const qreal &  angle,
const bool &  positive = false 
)
Parameters
angleUn angle quelconque
Returns
l'angle passe en parametre, mais ramene entre -360.0 + 360.0 degres
Here is the caller graph for this function:

◆ depthActionGroup()

QActionGroup * QET::depthActionGroup ( QObject *  parent = nullptr)

QET::depthActionGroup.

Parameters
parent
Returns
an action group which contain 4 actions (forward, raise, lower, backward) already made with icon, shortcut and data (see QET::DepthOption)
Here is the caller graph for this function:

◆ diagramAreaFromString()

QET::DiagramArea QET::diagramAreaFromString ( const QString &  string)
Parameters
stringune chaine representant un type de zone de schema
Returns
le type de zone de schema correspondant ; si la chaine est invalide, QET::ElementsArea est retourne.
Here is the caller graph for this function:

◆ diagramAreaToString()

QString QET::diagramAreaToString ( const QET::DiagramArea diagram_area)
Parameters
diagram_areaun type de zone de schema
Returns
une chaine representant le type de zone de schema
Here is the caller graph for this function:

◆ eachStrIsEqual()

bool QET::eachStrIsEqual ( const QStringList &  qsl)

QET::eachStrIsEqual.

Parameters
qsllist of string to compare
Returns
true if every string is identical, else false; The list must not be empty If the list can be empty, call isEmpty() before calling this function
Here is the caller graph for this function:

◆ ElementsAndConductorsSentence()

QString QET::ElementsAndConductorsSentence ( int  elements_count = 0,
int  conductors_count = 0,
int  texts_count = 0,
int  images_count = 0,
int  shapes_count = 0,
int  element_text_count = 0,
int  tables_count = 0,
int  terminal_strip_count = 0 
)

QET::ElementsAndConductorsSentence Permet de composer rapidement la proposition "x elements et y conducteurs" ou encore "x elements, y conducteurs et z champs de texte".

Parameters
elements_countnombre d'elements
conductors_countnombre de conducteurs
texts_countnombre de champs de texte
images_countnombre d'images
shapes_count
element_text_count
tables_count
Returns
la proposition decrivant le nombre d'elements, de conducteurs et de textes
Here is the caller graph for this function:

◆ escapeSpaces()

QString QET::escapeSpaces ( const QString &  string)
Parameters
stringune chaine de caracteres
Returns
la meme chaine de caracteres, mais avec les espaces et backslashes echappes
Here is the caller graph for this function:

◆ findInDomElement() [1/2]

QList< QDomElement > QET::findInDomElement ( const QDomElement &  e,
const QString &  tag_name 
)
Returns
the list of tag_name elements directly under the e XML element.
Here is the caller graph for this function:

◆ findInDomElement() [2/2]

QList< QDomElement > QET::findInDomElement ( const QDomElement &  e,
const QString &  parent,
const QString &  children 
)

Etant donne un element XML e, renvoie la liste de tous les elements children imbriques dans les elements parent, eux-memes enfants de l'elememt e

Parameters
eElement XML a explorer
parenttag XML intermediaire
childrentag XML a rechercher
Returns
La liste des elements XML children

◆ forbiddenCharacters()

QList< QChar > QET::forbiddenCharacters ( )
Returns
la liste des caracteres interdits dans les noms de fichiers sous Windows
Here is the caller graph for this function:

◆ joinWithSpaces()

QString QET::joinWithSpaces ( const QStringList &  string_list)

Assemble une liste de chaines en une seule. Un espace separe chaque chaine. Les espaces et backslashes des chaines sont echappes.

Parameters
string_listune liste de chaine
Returns
l'assemblage des chaines
Here is the call graph for this function:
Here is the caller graph for this function:

◆ license()

QString QET::license ( )
Returns
le texte de la licence de QElectroTech (GNU/GPL)
Here is the caller graph for this function:

◆ lineContainsPoint()

bool QET::lineContainsPoint ( const QLineF &  line,
const QPointF &  point 
)
Parameters
lineUn segment de droite
pointUn point
Returns
true si le point appartient au segment de droite, false sinon
Here is the caller graph for this function:

◆ orthogonalProjection()

bool QET::orthogonalProjection ( const QPointF &  point,
const QLineF &  line,
QPointF *  intersection = nullptr 
)
Parameters
pointUn point donne
lineUn segment de droite donnee
intersectionsi ce pointeur est different de 0, le QPointF ainsi designe contiendra les coordonnees du projete orthogonal, meme si celui-ci n'appartient pas au segment de droite
Returns
true si le projete orthogonal du point sur la droite appartient au segment de droite.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ qetCollectionFromString()

QET::QetCollection QET::qetCollectionFromString ( const QString &  str)

QET::qetCollectionFromString.

Parameters
strstring to convert
Returns
The corresponding QetCollection value from a string. If the string don't match anything, we return the failsafe value QetCollection::Common
Here is the caller graph for this function:

◆ qetCollectionToString()

QString QET::qetCollectionToString ( const QetCollection c)

QET::qetCollectionToString.

Parameters
cQetCollection value to convert
Returns
The QetCollection enum value converted to a QString
Here is the caller graph for this function:

◆ round()

qreal QET::round ( qreal  x,
qreal  epsilon 
)

Round x to the nearest multiple of the invert of epsilon. For instance, epsilon = 10 will round to 1/10 = 0.1

Here is the caller graph for this function:

◆ splitWithSpaces()

QStringList QET::splitWithSpaces ( const QString &  string)
Parameters
stringUne chaine de caracteres contenant des sous-chaines a extraire separees par des espaces non echappes. Les espaces des sous-chaines sont echappes.
Returns
La liste des sous-chaines, sans echappement.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringToFileName()

QString QET::stringToFileName ( const QString &  name)

Cette fonction transforme une chaine de caracteres (typiquement : un nom de schema, de projet, d'element) en un nom de fichier potable. Par nom de fichier potable, on entend un nom : ne comprenant pas de caracteres interdits sous Windows ne comprenant pas d'espace

Parameters
nameChaine de caractere a transformer en nom de fichier potable
Todo:
virer les caracteres accentues ?
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unescapeSpaces()

QString QET::unescapeSpaces ( const QString &  string)
Parameters
stringune chaine de caracteres
Returns
la meme chaine de caracteres, mais avec les espaces et backslashes non echappes
Here is the caller graph for this function:

◆ writeToFile()

bool QET::writeToFile ( QDomDocument &  xml_doc,
QFile *  file,
QString *  error_message = nullptr 
)
Here is the caller graph for this function:

◆ writeXmlFile()

bool QET::writeXmlFile ( QDomDocument &  xml_doc,
const QString &  filepath,
QString *  error_message = nullptr 
)

Export an XML document to an UTF-8 text file indented with 4 spaces, with LF end of lines and no BOM.

Parameters
xml_docAn XML document to be exported
filepathPath to the file to be written
error_messageIf non-zero, will contain an error message explaining what happened when this function returns false.
Returns
false if an error occurred, true otherwise
Here is the caller graph for this function: