mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
fix deprecated warning QString::SplitBehavior
enum QString::SplitBehavior This enum is obsolete. Use Qt::SplitBehavior instead. This enum was introduced or modified in Qt 5.14.
This commit is contained in:
committed by
Laurent Trinques
parent
2570108caf
commit
2ec018a4e9
@@ -638,7 +638,11 @@ void ElementsCollectionWidget::search()
|
||||
}
|
||||
|
||||
hideCollection(true);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList text_list = text.split("+", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList text_list = text.split("+", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QModelIndexList match_index;
|
||||
foreach (QString txt, text_list) {
|
||||
match_index << m_model->match(m_showed_index.isValid() ? m_model->index(0,0,m_showed_index) : m_model->index(0,0),
|
||||
|
||||
@@ -730,7 +730,11 @@ void ConductorProperties::readStyle(const QString &style_string) {
|
||||
if (style_string.isEmpty()) return;
|
||||
|
||||
// recupere la liste des couples style / valeur
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList styles = style_string.split(";", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList styles = style_string.split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-z-]+)\\s*$");
|
||||
foreach (QString style_str, styles) {
|
||||
|
||||
@@ -495,7 +495,11 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
resetStyles();
|
||||
|
||||
//Get the list of pair style/value
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList styles = qde.attribute("style").split(";", QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList styles = qde.attribute("style").split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
//Check each pair of style
|
||||
QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$");
|
||||
|
||||
@@ -556,8 +556,11 @@ void ElementPictureFactory::setPainterStyle(const QDomElement &dom, QPainter &pa
|
||||
pen.setCapStyle(Qt::SquareCap);
|
||||
|
||||
//Get the couples style/value
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
const QStringList styles = dom.attribute("style").split(";", QString::SkipEmptyParts);
|
||||
|
||||
#else
|
||||
const QStringList styles = dom.attribute("style").split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$");
|
||||
for (QString style : styles) {
|
||||
if (rx.exactMatch(style)) {
|
||||
|
||||
@@ -447,8 +447,12 @@ QString QET::joinWithSpaces(const QStringList &string_list) {
|
||||
*/
|
||||
QStringList QET::splitWithSpaces(const QString &string) {
|
||||
// les chaines sont separees par des espaces non echappes = avec un nombre nul ou pair de backslashes devant
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList escaped_strings = string.split(QRegExp("[^\\]?(?:\\\\)* "), QString::SkipEmptyParts);
|
||||
|
||||
#else
|
||||
QStringList escaped_strings = string.split(QRegExp("[^\\]?(?:\\\\)* "), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
QStringList returned_list;
|
||||
foreach(QString escaped_string, escaped_strings) {
|
||||
returned_list << QET::unescapeSpaces(escaped_string);
|
||||
|
||||
@@ -334,8 +334,12 @@ void TitleBlockTemplate::parseRows(const QString &rows_string) {
|
||||
// parse the rows attribute: we expect a serie of absolute heights
|
||||
QRegExp row_size_format("^([0-9]+)(?:px)?$", Qt::CaseInsensitive);
|
||||
bool conv_ok;
|
||||
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList rows_descriptions = rows_string.split(QChar(';'), QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList rows_descriptions = rows_string.split(QChar(';'), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
foreach (QString rows_description, rows_descriptions) {
|
||||
if (row_size_format.exactMatch(rows_description)) {
|
||||
int row_size = row_size_format.capturedTexts().at(1).toInt(&conv_ok);
|
||||
@@ -357,8 +361,12 @@ void TitleBlockTemplate::parseColumns(const QString &cols_string) {
|
||||
QRegExp abs_col_size_format("^([0-9]+)(?:px)?$", Qt::CaseInsensitive);
|
||||
QRegExp rel_col_size_format("^([rt])([0-9]+)%$", Qt::CaseInsensitive);
|
||||
bool conv_ok;
|
||||
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) // ### Qt 6: remove
|
||||
QStringList cols_descriptions = cols_string.split(QChar(';'), QString::SkipEmptyParts);
|
||||
#else
|
||||
QStringList cols_descriptions = cols_string.split(QChar(';'), Qt::SkipEmptyParts);
|
||||
#endif
|
||||
foreach (QString cols_description, cols_descriptions) {
|
||||
if (abs_col_size_format.exactMatch(cols_description)) {
|
||||
int col_size = abs_col_size_format.capturedTexts().at(1).toInt(&conv_ok);
|
||||
|
||||
Reference in New Issue
Block a user