|
template<typename T > |
static QSet< T > | toSet (const QList< T > &list) noexcept |
| Helper method to convert a QList<T> to a QSet<T> More...
|
|
template<typename T > |
static QList< T > | sortedQSet (const QSet< T > &set) noexcept |
|
template<typename T > |
static T | sorted (const T &container) noexcept |
|
template<typename T , typename Compare > |
static void | sortNumeric (T &container, Compare compare, Qt::CaseSensitivity caseSensitivity=Qt::CaseInsensitive, bool ignorePunctuation=false) noexcept |
| Sort a container of arbitrary objects using QCollators numeric mode. More...
|
|
template<typename T > |
static void | sortNumeric (T &container, Qt::CaseSensitivity caseSensitivity=Qt::CaseInsensitive, bool ignorePunctuation=false) noexcept |
| Sort a container of strings using QCollators numeric mode. More...
|
|
static bool | isTextUpsideDown (const Angle &rotation) noexcept |
| Check if a text with a given rotation is considered as upside down. More...
|
|
static QRectF | boundingRectFromRadius (qreal radius) noexcept |
|
static QRectF | boundingRectFromRadius (qreal rx, qreal ry) noexcept |
|
static QRectF | adjustedBoundingRect (const QRectF &rect, qreal offset) noexcept |
|
static QPainterPath | shapeFromPath (const QPainterPath &path, const QPen &pen, const QBrush &brush, const UnsignedLength &minWidth=UnsignedLength(0)) noexcept |
|
static Length | arcRadius (const Point &p1, const Point &p2, const Angle &a) noexcept |
|
static Point | arcCenter (const Point &p1, const Point &p2, const Angle &a) noexcept |
|
static Angle | arcAngle (const Point &p1, const Point &p2, const Point ¢er=Point(0, 0)) noexcept |
| Calculate the angle between two given points. More...
|
|
static Angle | angleBetweenPoints (const Point &p1, const Point &p2) noexcept |
| Calculate the angle between two points. More...
|
|
static Point | nearestPointOnLine (const Point &p, const Point &l1, const Point &l2) noexcept |
| Calculate the point on a given line which is nearest to a given point. More...
|
|
static UnsignedLength | shortestDistanceBetweenPointAndLine (const Point &p, const Point &l1, const Point &l2, Point *nearest=nullptr) noexcept |
| Calculate the shortest distance between a given point and a given line. More...
|
|
static QString | incrementNumberInString (QString string) noexcept |
| Copy a string while incrementing its contained number. More...
|
|
static QStringList | expandRangesInString (const QString &string) noexcept |
| Expand ranges like "1..5" in a string to all its values. More...
|
|
static QString | cleanUserInputString (const QString &input, const QRegularExpression &removeRegex, bool trim=true, bool toLower=false, bool toUpper=false, const QString &spaceReplacement=" ", int maxLength=-1) noexcept |
| Clean a user input string. More...
|
|
static QString | prettyPrintLocale (const QString &code) noexcept |
| Pretty print the name of a QLocale. More...
|
|
template<typename T > |
static QString | floatToString (T value, int decimals, const QLocale &locale) noexcept |
| Convert a float or double to a localized string. More...
|
|
template<typename T > |
static QString | decimalFixedPointToString (T value, qint32 pointPos) noexcept |
| Convert a fixed point decimal number from an integer to a QString. More...
|
|
template<typename T > |
static T | decimalFixedPointFromString (const QString &str, qint32 pointPos) |
| Convert a fixed point decimal number from a QString to an integer. More...
|
|
The Toolbox class provides some useful general purpose methods.
QStringList expandRangesInString |
( |
const QString & |
string | ) |
|
|
staticnoexcept |
Expand ranges like "1..5" in a string to all its values.
A range is either defined by two integers with ".." in between, or two ASCII letters with ".." in between. If multiple ranges are contained, all combinations of them will be created.
For example the string "X1..10_A..C" expands to the list ["X1_A", "X1_B", "X1_C", ..., "X10_C"].
- Note
- Minus ('-') and plus ('+') characters are not interpreted as the sign of a number because in EDA tools they often are considered as strings, not as number signs (e.g. the inputs of an OpAmp).
- Parameters
-
string | The input string (may or may not contain ranges). |
- Returns
- A list with expanded ranges in all combinations. If the input string does not contain ranges, a list with one element (equal to the input) is returned.