QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Functions
QETUtils Namespace Reference

Functions

QString marginsToString (const QMargins &margins)
 QETUtils::marginsToString.
 
QMargins marginsFromString (const QString &string)
 QETUtils::marginsFromString.
 
qreal graphicsHandlerSize (QGraphicsItem *item)
 QETUtils::graphicsHandlerSize.
 
bool sortBeginIntString (const QString &str_a, const QString &str_b)
 QETUtils::sortBeginIntString Sort the string str_a and str_b and take in count if string begin with an int to sort it as int and not as string in this case. For example if we have to sort the string : "3str", 10str", "100str", "2str", "20str". The default behavior when sorting QString with the comparison operator will be: "10str" "100str" "2str", "20str", "3str" When sorting with this function, the result will be : "10str", "2str", "3str", "20str", "100str".
 
template<typename T >
QVector< QWeakPointer< T > > sharedVectorToWeak (const QVector< QSharedPointer< T > > &vector)
 
template<typename T >
QVector< QSharedPointer< T > > weakVectorToShared (const QVector< QWeakPointer< T > > &vector)
 

Detailed Description

Provide some small utils function

Function Documentation

◆ graphicsHandlerSize()

qreal QETUtils::graphicsHandlerSize ( QGraphicsItem *  item)

QETUtils::graphicsHandlerSize.

Parameters
item
Returns
Return the handler size to use in the QGraphicsScene of item. If size can't be found, return 10 by default.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ marginsFromString()

QMargins QETUtils::marginsFromString ( const QString &  string)

QETUtils::marginsFromString.

Parameters
string
Returns
QMargins margins
Here is the caller graph for this function:

◆ marginsToString()

QString QETUtils::marginsToString ( const QMargins &  margins)

QETUtils::marginsToString.

Parameters
margins
Returns
QString str "left;top;right;bottom"
Here is the caller graph for this function:

◆ sharedVectorToWeak()

template<typename T >
QVector< QWeakPointer< T > > QETUtils::sharedVectorToWeak ( const QVector< QSharedPointer< T > > &  vector)

◆ sortBeginIntString()

bool QETUtils::sortBeginIntString ( const QString &  str_a,
const QString &  str_b 
)

QETUtils::sortBeginIntString Sort the string str_a and str_b and take in count if string begin with an int to sort it as int and not as string in this case. For example if we have to sort the string : "3str", 10str", "100str", "2str", "20str". The default behavior when sorting QString with the comparison operator will be: "10str" "100str" "2str", "20str", "3str" When sorting with this function, the result will be : "10str", "2str", "3str", "20str", "100str".

Parameters
str_a
str_b
Returns

◆ weakVectorToShared()

template<typename T >
QVector< QSharedPointer< T > > QETUtils::weakVectorToShared ( const QVector< QWeakPointer< T > > &  vector)