Fix deprecated QRegExp

Use QRegularExpression instead.

https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users

This function was introduced in Qt 5
This commit is contained in:
Simon De Backer
2020-09-18 23:04:17 +02:00
parent 0ee8f4187b
commit 46e96f0a67

View File

@@ -51,9 +51,10 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
m_titleblock_template_renderer -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
// disable the QPicture-based cache from Qt 4.8 to avoid rendering errors and crashes
if (!QRegExp("4\\.[0-7]\\.").exactMatch(qVersion())) {
m_titleblock_template_renderer -> setUseCache(false);
}
#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0) // ### Qt 6: remove
#else
m_titleblock_template_renderer -> setUseCache(false);
#endif
// dimensions par defaut du schema
importBorder(BorderProperties());
@@ -651,13 +652,13 @@ void BorderTitleBlock::drawDxf(
// dessine la numerotation des colonnes
if (display_border_ &&
display_columns_) {
int offset = settings.value("border-columns_0", true).toBool() ? -1 : 0;
int offset = settings.value("border-columns_0", true).toBool() ? -1 : 0;
for (int i = 1 ; i <= columns_count_ ; ++ i) {
double xCoord = diagram_rect_.topLeft().x() * Createdxf::xScale +
double xCoord = diagram_rect_.topLeft().x() * Createdxf::xScale +
(rows_header_width_ + ((i - 1) *
columns_width_));
double yCoord = Createdxf::sheetHeight
- diagram_rect_.topLeft().y()*Createdxf::yScale
- diagram_rect_.topLeft().y()*Createdxf::yScale
- columns_header_height_;
double recWidth = columns_width_;
double recHeight = columns_header_height_;
@@ -665,18 +666,18 @@ void BorderTitleBlock::drawDxf(
recWidth, recHeight, color);
Createdxf::drawTextAligned(file_path,
QString::number(i + offset),
xCoord+recWidth/4,
yCoord + recHeight*0.5,
QString::number(i + offset),
xCoord+recWidth/4,
yCoord + recHeight*0.5,
recHeight*0.7,
0,
0,
1,
2,
xCoord+recWidth/2,
1,
xCoord+recWidth/2,
1,
color);
}
}
}
// draw line numbering
@@ -686,8 +687,8 @@ void BorderTitleBlock::drawDxf(
for (int i = 1 ; i <= rows_count_ ; ++ i) {
double xCoord = diagram_rect_.topLeft().x()
* Createdxf::xScale;
double yCoord = Createdxf::sheetHeight
- diagram_rect_.topLeft().y()
double yCoord = Createdxf::sheetHeight
- diagram_rect_.topLeft().y()
*Createdxf::yScale
- (
columns_header_height_
@@ -700,15 +701,15 @@ void BorderTitleBlock::drawDxf(
recWidth, recHeight, color);
Createdxf::drawTextAligned(file_path,
row_string,
xCoord+recWidth*0.1,
yCoord + recHeight*0.4,
xCoord+recWidth*0.1,
yCoord + recHeight*0.4,
recWidth*0.7,
0,
0,
1,
2,
xCoord+recWidth/2,
1,
1,
color);
row_string = incrementLetters(row_string);
}