From 471a6cbd07fddd3f392204d532ac8d3639c7dc7f Mon Sep 17 00:00:00 2001 From: Tomi Korpipaa Date: Thu, 10 Dec 2020 07:12:10 +0200 Subject: Migrate C++ API rendering path to Qt 6 Replace QRegExp with QRegularExpression and change usage accordingly. Replace shared QOpenGLFunctions_2_1 with our own copy. Fix header include changes. Task-number: QTBUG-89297 Change-Id: I6d3cf36ba9303ef62db3220816ea35f51eb26a3c Reviewed-by: Miikka Heikkinen --- src/datavisualization/data/baritemmodelhandler.cpp | 12 +++---- src/datavisualization/data/baritemmodelhandler_p.h | 4 +-- .../data/qitemmodelbardataproxy.cpp | 34 +++++++++--------- .../data/qitemmodelbardataproxy.h | 34 +++++++++--------- .../data/qitemmodelbardataproxy_p.h | 8 ++--- .../data/qitemmodelscatterdataproxy.cpp | 34 +++++++++--------- .../data/qitemmodelscatterdataproxy.h | 34 +++++++++--------- .../data/qitemmodelscatterdataproxy_p.h | 8 ++--- .../data/qitemmodelsurfacedataproxy.cpp | 42 +++++++++++----------- .../data/qitemmodelsurfacedataproxy.h | 42 +++++++++++----------- .../data/qitemmodelsurfacedataproxy_p.h | 10 +++--- .../data/scatteritemmodelhandler.cpp | 8 ++--- .../data/scatteritemmodelhandler_p.h | 8 ++--- .../data/surfaceitemmodelhandler.cpp | 14 ++++---- .../data/surfaceitemmodelhandler_p.h | 6 ++-- .../engine/abstract3drenderer.cpp | 4 ++- .../engine/abstract3drenderer_p.h | 4 +-- .../global/datavisualizationglobal_p.h | 1 + src/datavisualization/utils/texturehelper.cpp | 6 ++-- src/datavisualization/utils/texturehelper_p.h | 4 +-- src/datavisualization/utils/utils.cpp | 25 +++++++------ .../auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp | 30 ++++++++-------- .../cpptest/q3dscatter-modelproxy/tst_proxy.cpp | 30 ++++++++-------- .../cpptest/q3dsurface-modelproxy/tst_proxy.cpp | 36 +++++++++---------- tests/manual/itemmodeltest/main.cpp | 10 +++--- 25 files changed, 228 insertions(+), 220 deletions(-) diff --git a/src/datavisualization/data/baritemmodelhandler.cpp b/src/datavisualization/data/baritemmodelhandler.cpp index 5a2d92cd..c09e97c9 100644 --- a/src/datavisualization/data/baritemmodelhandler.cpp +++ b/src/datavisualization/data/baritemmodelhandler.cpp @@ -108,18 +108,18 @@ void BarItemModelHandler::resolveModel() // Value and rotation patterns can be reused on single item changes, // so store them to member variables. - QRegExp rowPattern(m_proxy->rowRolePattern()); - QRegExp colPattern(m_proxy->columnRolePattern()); + QRegularExpression rowPattern(m_proxy->rowRolePattern()); + QRegularExpression colPattern(m_proxy->columnRolePattern()); m_valuePattern = m_proxy->valueRolePattern(); m_rotationPattern = m_proxy->rotationRolePattern(); QString rowReplace = m_proxy->rowRoleReplace(); QString colReplace = m_proxy->columnRoleReplace(); m_valueReplace = m_proxy->valueRoleReplace(); m_rotationReplace = m_proxy->rotationRoleReplace(); - bool haveRowPattern = !rowPattern.isEmpty() && rowPattern.isValid(); - bool haveColPattern = !colPattern.isEmpty() && colPattern.isValid(); - m_haveValuePattern = !m_valuePattern.isEmpty() && m_valuePattern.isValid(); - m_haveRotationPattern = !m_rotationPattern.isEmpty() && m_rotationPattern.isValid(); + bool haveRowPattern = !rowPattern.namedCaptureGroups().isEmpty() && rowPattern.isValid(); + bool haveColPattern = !colPattern.namedCaptureGroups().isEmpty() && colPattern.isValid(); + m_haveValuePattern = !m_valuePattern.namedCaptureGroups().isEmpty() && m_valuePattern.isValid(); + m_haveRotationPattern = !m_rotationPattern.namedCaptureGroups().isEmpty() && m_rotationPattern.isValid(); QStringList rowLabels; QStringList columnLabels; diff --git a/src/datavisualization/data/baritemmodelhandler_p.h b/src/datavisualization/data/baritemmodelhandler_p.h index 4b3acdd5..0363ad05 100644 --- a/src/datavisualization/data/baritemmodelhandler_p.h +++ b/src/datavisualization/data/baritemmodelhandler_p.h @@ -64,8 +64,8 @@ protected: int m_columnCount; int m_valueRole; int m_rotationRole; - QRegExp m_valuePattern; - QRegExp m_rotationPattern; + QRegularExpression m_valuePattern; + QRegularExpression m_rotationPattern; QString m_valueReplace; QString m_rotationReplace; bool m_haveValuePattern; diff --git a/src/datavisualization/data/qitemmodelbardataproxy.cpp b/src/datavisualization/data/qitemmodelbardataproxy.cpp index f87016e1..d901b07d 100644 --- a/src/datavisualization/data/qitemmodelbardataproxy.cpp +++ b/src/datavisualization/data/qitemmodelbardataproxy.cpp @@ -76,7 +76,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * If the fields of the model do not contain the data in the exact format you need, you can specify * a search pattern regular expression and a replace rule for each role to get the value in a * format you need. For more information how the replace using regular expressions works, see - * QString::replace(const QRegExp &rx, const QString &after) function documentation. Note that + * QString::replace(const QRegularExpression &rx, const QString &after) function documentation. Note that * using regular expressions has an impact on the performance, so it's more efficient to utilize * item models where doing search and replace is not necessary to get the desired values. * @@ -215,7 +215,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \qmlproperty string ItemModelBarDataProxy::rowRoleReplace * This property defines the replace content to be used in conjunction with rowRolePattern. * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rowRole, rowRolePattern @@ -225,7 +225,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \qmlproperty string ItemModelBarDataProxy::columnRoleReplace * This property defines the replace content to be used in conjunction with columnRolePattern. * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa columnRole, columnRolePattern @@ -235,7 +235,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \qmlproperty string ItemModelBarDataProxy::valueRoleReplace * This property defines the replace content to be used in conjunction with valueRolePattern. * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa valueRole, valueRolePattern @@ -245,7 +245,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \qmlproperty string ItemModelBarDataProxy::rotationRoleReplace * This property defines the replace content to be used in conjunction with rotationRolePattern. * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rotationRole, rotationRolePattern @@ -669,7 +669,7 @@ int QItemModelBarDataProxy::columnCategoryIndex(const QString &category) * * \sa rowRole, rowRoleReplace */ -void QItemModelBarDataProxy::setRowRolePattern(const QRegExp &pattern) +void QItemModelBarDataProxy::setRowRolePattern(const QRegularExpression &pattern) { if (dptr()->m_rowRolePattern != pattern) { dptr()->m_rowRolePattern = pattern; @@ -677,7 +677,7 @@ void QItemModelBarDataProxy::setRowRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelBarDataProxy::rowRolePattern() const +QRegularExpression QItemModelBarDataProxy::rowRolePattern() const { return dptrc()->m_rowRolePattern; } @@ -695,7 +695,7 @@ QRegExp QItemModelBarDataProxy::rowRolePattern() const * * \sa columnRole, columnRoleReplace */ -void QItemModelBarDataProxy::setColumnRolePattern(const QRegExp &pattern) +void QItemModelBarDataProxy::setColumnRolePattern(const QRegularExpression &pattern) { if (dptr()->m_columnRolePattern != pattern) { dptr()->m_columnRolePattern = pattern; @@ -703,7 +703,7 @@ void QItemModelBarDataProxy::setColumnRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelBarDataProxy::columnRolePattern() const +QRegularExpression QItemModelBarDataProxy::columnRolePattern() const { return dptrc()->m_columnRolePattern; } @@ -719,7 +719,7 @@ QRegExp QItemModelBarDataProxy::columnRolePattern() const * * \sa valueRole, valueRoleReplace */ -void QItemModelBarDataProxy::setValueRolePattern(const QRegExp &pattern) +void QItemModelBarDataProxy::setValueRolePattern(const QRegularExpression &pattern) { if (dptr()->m_valueRolePattern != pattern) { dptr()->m_valueRolePattern = pattern; @@ -727,7 +727,7 @@ void QItemModelBarDataProxy::setValueRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelBarDataProxy::valueRolePattern() const +QRegularExpression QItemModelBarDataProxy::valueRolePattern() const { return dptrc()->m_valueRolePattern; } @@ -743,7 +743,7 @@ QRegExp QItemModelBarDataProxy::valueRolePattern() const * * \sa rotationRole, rotationRoleReplace */ -void QItemModelBarDataProxy::setRotationRolePattern(const QRegExp &pattern) +void QItemModelBarDataProxy::setRotationRolePattern(const QRegularExpression &pattern) { if (dptr()->m_rotationRolePattern != pattern) { dptr()->m_rotationRolePattern = pattern; @@ -751,7 +751,7 @@ void QItemModelBarDataProxy::setRotationRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelBarDataProxy::rotationRolePattern() const +QRegularExpression QItemModelBarDataProxy::rotationRolePattern() const { return dptrc()->m_rotationRolePattern; } @@ -762,7 +762,7 @@ QRegExp QItemModelBarDataProxy::rotationRolePattern() const * \brief The replace content to be used in conjunction with rowRolePattern. * * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rowRole, rowRolePattern @@ -786,7 +786,7 @@ QString QItemModelBarDataProxy::rowRoleReplace() const * \brief The replace content to be used in conjunction with columnRolePattern. * * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa columnRole, columnRolePattern @@ -810,7 +810,7 @@ QString QItemModelBarDataProxy::columnRoleReplace() const * \brief The replace content to be used in conjunction with valueRolePattern. * * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa valueRole, valueRolePattern @@ -835,7 +835,7 @@ QString QItemModelBarDataProxy::valueRoleReplace() const * rotationRolePattern. * * Defaults to empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rotationRole, rotationRolePattern diff --git a/src/datavisualization/data/qitemmodelbardataproxy.h b/src/datavisualization/data/qitemmodelbardataproxy.h index 2dfa0753..7ac5d64a 100644 --- a/src/datavisualization/data/qitemmodelbardataproxy.h +++ b/src/datavisualization/data/qitemmodelbardataproxy.h @@ -32,7 +32,7 @@ #include #include -#include +#include QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -52,10 +52,10 @@ class QT_DATAVISUALIZATION_EXPORT QItemModelBarDataProxy : public QBarDataProxy Q_PROPERTY(bool useModelCategories READ useModelCategories WRITE setUseModelCategories NOTIFY useModelCategoriesChanged) Q_PROPERTY(bool autoRowCategories READ autoRowCategories WRITE setAutoRowCategories NOTIFY autoRowCategoriesChanged) Q_PROPERTY(bool autoColumnCategories READ autoColumnCategories WRITE setAutoColumnCategories NOTIFY autoColumnCategoriesChanged) - Q_PROPERTY(QRegExp rowRolePattern READ rowRolePattern WRITE setRowRolePattern NOTIFY rowRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp columnRolePattern READ columnRolePattern WRITE setColumnRolePattern NOTIFY columnRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp valueRolePattern READ valueRolePattern WRITE setValueRolePattern NOTIFY valueRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp rotationRolePattern READ rotationRolePattern WRITE setRotationRolePattern NOTIFY rotationRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression rowRolePattern READ rowRolePattern WRITE setRowRolePattern NOTIFY rowRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression columnRolePattern READ columnRolePattern WRITE setColumnRolePattern NOTIFY columnRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression valueRolePattern READ valueRolePattern WRITE setValueRolePattern NOTIFY valueRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression rotationRolePattern READ rotationRolePattern WRITE setRotationRolePattern NOTIFY rotationRolePatternChanged REVISION 1) Q_PROPERTY(QString rowRoleReplace READ rowRoleReplace WRITE setRowRoleReplace NOTIFY rowRoleReplaceChanged REVISION 1) Q_PROPERTY(QString columnRoleReplace READ columnRoleReplace WRITE setColumnRoleReplace NOTIFY columnRoleReplaceChanged REVISION 1) Q_PROPERTY(QString valueRoleReplace READ valueRoleReplace WRITE setValueRoleReplace NOTIFY valueRoleReplaceChanged REVISION 1) @@ -122,14 +122,14 @@ public: Q_INVOKABLE int rowCategoryIndex(const QString& category); Q_INVOKABLE int columnCategoryIndex(const QString& category); - void setRowRolePattern(const QRegExp &pattern); - QRegExp rowRolePattern() const; - void setColumnRolePattern(const QRegExp &pattern); - QRegExp columnRolePattern() const; - void setValueRolePattern(const QRegExp &pattern); - QRegExp valueRolePattern() const; - void setRotationRolePattern(const QRegExp &pattern); - QRegExp rotationRolePattern() const; + void setRowRolePattern(const QRegularExpression &pattern); + QRegularExpression rowRolePattern() const; + void setColumnRolePattern(const QRegularExpression &pattern); + QRegularExpression columnRolePattern() const; + void setValueRolePattern(const QRegularExpression &pattern); + QRegularExpression valueRolePattern() const; + void setRotationRolePattern(const QRegularExpression &pattern); + QRegularExpression rotationRolePattern() const; void setRowRoleReplace(const QString &replace); QString rowRoleReplace() const; @@ -154,10 +154,10 @@ Q_SIGNALS: void useModelCategoriesChanged(bool enable); void autoRowCategoriesChanged(bool enable); void autoColumnCategoriesChanged(bool enable); - Q_REVISION(1) void rowRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void columnRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void valueRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void rotationRolePatternChanged(const QRegExp &pattern); + Q_REVISION(1) void rowRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void columnRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void valueRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void rotationRolePatternChanged(const QRegularExpression &pattern); Q_REVISION(1) void rowRoleReplaceChanged(const QString &replace); Q_REVISION(1) void columnRoleReplaceChanged(const QString &replace); Q_REVISION(1) void valueRoleReplaceChanged(const QString &replace); diff --git a/src/datavisualization/data/qitemmodelbardataproxy_p.h b/src/datavisualization/data/qitemmodelbardataproxy_p.h index a4eefbcd..7b9b691a 100644 --- a/src/datavisualization/data/qitemmodelbardataproxy_p.h +++ b/src/datavisualization/data/qitemmodelbardataproxy_p.h @@ -74,10 +74,10 @@ private: bool m_autoRowCategories; bool m_autoColumnCategories; - QRegExp m_rowRolePattern; - QRegExp m_columnRolePattern; - QRegExp m_valueRolePattern; - QRegExp m_rotationRolePattern; + QRegularExpression m_rowRolePattern; + QRegularExpression m_columnRolePattern; + QRegularExpression m_valueRolePattern; + QRegularExpression m_rotationRolePattern; QString m_rowRoleReplace; QString m_columnRoleReplace; diff --git a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp index 58180e69..a2c7e41a 100644 --- a/src/datavisualization/data/qitemmodelscatterdataproxy.cpp +++ b/src/datavisualization/data/qitemmodelscatterdataproxy.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * If the fields of the model do not contain the data in the exact format you need, you can specify * a search pattern regular expression and a replace rule for each role to get the value in a * format you need. For more information how the replace using regular expressions works, see - * QString::replace(const QRegExp &rx, const QString &after) function documentation. Note that + * QString::replace(const QRegularExpression &rx, const QString &after) function documentation. Note that * using regular expressions has an impact on the performance, so it's more efficient to utilize * item models where doing search and replace is not necessary to get the desired values. * @@ -170,7 +170,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * * This property defines the replace content to be used in conjunction with xPosRolePattern. * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa xPosRole, xPosRolePattern @@ -181,7 +181,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * * This property defines the replace content to be used in conjunction with yPosRolePattern. * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa yPosRole, yPosRolePattern @@ -192,7 +192,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * * This property defines the replace content to be used in conjunction with zPosRolePattern. * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa zPosRole, zPosRolePattern @@ -202,7 +202,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * \qmlproperty string ItemModelScatterDataProxy::rotationRoleReplace * This property defines the replace content to be used in conjunction with rotationRolePattern. * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rotationRole, rotationRolePattern @@ -386,7 +386,7 @@ QString QItemModelScatterDataProxy::rotationRole() const * * \sa xPosRole, xPosRoleReplace */ -void QItemModelScatterDataProxy::setXPosRolePattern(const QRegExp &pattern) +void QItemModelScatterDataProxy::setXPosRolePattern(const QRegularExpression &pattern) { if (dptr()->m_xPosRolePattern != pattern) { dptr()->m_xPosRolePattern = pattern; @@ -394,7 +394,7 @@ void QItemModelScatterDataProxy::setXPosRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelScatterDataProxy::xPosRolePattern() const +QRegularExpression QItemModelScatterDataProxy::xPosRolePattern() const { return dptrc()->m_xPosRolePattern; } @@ -410,7 +410,7 @@ QRegExp QItemModelScatterDataProxy::xPosRolePattern() const * * \sa yPosRole, yPosRoleReplace */ -void QItemModelScatterDataProxy::setYPosRolePattern(const QRegExp &pattern) +void QItemModelScatterDataProxy::setYPosRolePattern(const QRegularExpression &pattern) { if (dptr()->m_yPosRolePattern != pattern) { dptr()->m_yPosRolePattern = pattern; @@ -418,7 +418,7 @@ void QItemModelScatterDataProxy::setYPosRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelScatterDataProxy::yPosRolePattern() const +QRegularExpression QItemModelScatterDataProxy::yPosRolePattern() const { return dptrc()->m_yPosRolePattern; } @@ -434,7 +434,7 @@ QRegExp QItemModelScatterDataProxy::yPosRolePattern() const * * \sa zPosRole, zPosRoleReplace */ -void QItemModelScatterDataProxy::setZPosRolePattern(const QRegExp &pattern) +void QItemModelScatterDataProxy::setZPosRolePattern(const QRegularExpression &pattern) { if (dptr()->m_zPosRolePattern != pattern) { dptr()->m_zPosRolePattern = pattern; @@ -442,7 +442,7 @@ void QItemModelScatterDataProxy::setZPosRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelScatterDataProxy::zPosRolePattern() const +QRegularExpression QItemModelScatterDataProxy::zPosRolePattern() const { return dptrc()->m_zPosRolePattern; } @@ -458,7 +458,7 @@ QRegExp QItemModelScatterDataProxy::zPosRolePattern() const * * \sa rotationRole, rotationRoleReplace */ -void QItemModelScatterDataProxy::setRotationRolePattern(const QRegExp &pattern) +void QItemModelScatterDataProxy::setRotationRolePattern(const QRegularExpression &pattern) { if (dptr()->m_rotationRolePattern != pattern) { dptr()->m_rotationRolePattern = pattern; @@ -466,7 +466,7 @@ void QItemModelScatterDataProxy::setRotationRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelScatterDataProxy::rotationRolePattern() const +QRegularExpression QItemModelScatterDataProxy::rotationRolePattern() const { return dptrc()->m_rotationRolePattern; } @@ -478,7 +478,7 @@ QRegExp QItemModelScatterDataProxy::rotationRolePattern() const * pattern. * * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa xPosRole, xPosRolePattern @@ -503,7 +503,7 @@ QString QItemModelScatterDataProxy::xPosRoleReplace() const * pattern. * * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa yPosRole, yPosRolePattern @@ -528,7 +528,7 @@ QString QItemModelScatterDataProxy::yPosRoleReplace() const * pattern. * * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa zPosRole, zPosRolePattern @@ -553,7 +553,7 @@ QString QItemModelScatterDataProxy::zPosRoleReplace() const * pattern. * * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rotationRole, rotationRolePattern diff --git a/src/datavisualization/data/qitemmodelscatterdataproxy.h b/src/datavisualization/data/qitemmodelscatterdataproxy.h index 9a85c4aa..ae321b65 100644 --- a/src/datavisualization/data/qitemmodelscatterdataproxy.h +++ b/src/datavisualization/data/qitemmodelscatterdataproxy.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -47,10 +47,10 @@ class QT_DATAVISUALIZATION_EXPORT QItemModelScatterDataProxy : public QScatterDa Q_PROPERTY(QString yPosRole READ yPosRole WRITE setYPosRole NOTIFY yPosRoleChanged) Q_PROPERTY(QString zPosRole READ zPosRole WRITE setZPosRole NOTIFY zPosRoleChanged) Q_PROPERTY(QString rotationRole READ rotationRole WRITE setRotationRole NOTIFY rotationRoleChanged) - Q_PROPERTY(QRegExp xPosRolePattern READ xPosRolePattern WRITE setXPosRolePattern NOTIFY xPosRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp yPosRolePattern READ yPosRolePattern WRITE setYPosRolePattern NOTIFY yPosRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp zPosRolePattern READ zPosRolePattern WRITE setZPosRolePattern NOTIFY zPosRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp rotationRolePattern READ rotationRolePattern WRITE setRotationRolePattern NOTIFY rotationRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression xPosRolePattern READ xPosRolePattern WRITE setXPosRolePattern NOTIFY xPosRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression yPosRolePattern READ yPosRolePattern WRITE setYPosRolePattern NOTIFY yPosRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression zPosRolePattern READ zPosRolePattern WRITE setZPosRolePattern NOTIFY zPosRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression rotationRolePattern READ rotationRolePattern WRITE setRotationRolePattern NOTIFY rotationRolePatternChanged REVISION 1) Q_PROPERTY(QString xPosRoleReplace READ xPosRoleReplace WRITE setXPosRoleReplace NOTIFY xPosRoleReplaceChanged REVISION 1) Q_PROPERTY(QString yPosRoleReplace READ yPosRoleReplace WRITE setYPosRoleReplace NOTIFY yPosRoleReplaceChanged REVISION 1) Q_PROPERTY(QString zPosRoleReplace READ zPosRoleReplace WRITE setZPosRoleReplace NOTIFY zPosRoleReplaceChanged REVISION 1) @@ -83,14 +83,14 @@ public: void remap(const QString &xPosRole, const QString &yPosRole, const QString &zPosRole, const QString &rotationRole); - void setXPosRolePattern(const QRegExp &pattern); - QRegExp xPosRolePattern() const; - void setYPosRolePattern(const QRegExp &pattern); - QRegExp yPosRolePattern() const; - void setZPosRolePattern(const QRegExp &pattern); - QRegExp zPosRolePattern() const; - void setRotationRolePattern(const QRegExp &pattern); - QRegExp rotationRolePattern() const; + void setXPosRolePattern(const QRegularExpression &pattern); + QRegularExpression xPosRolePattern() const; + void setYPosRolePattern(const QRegularExpression &pattern); + QRegularExpression yPosRolePattern() const; + void setZPosRolePattern(const QRegularExpression &pattern); + QRegularExpression zPosRolePattern() const; + void setRotationRolePattern(const QRegularExpression &pattern); + QRegularExpression rotationRolePattern() const; void setXPosRoleReplace(const QString &replace); QString xPosRoleReplace() const; @@ -107,10 +107,10 @@ Q_SIGNALS: void yPosRoleChanged(const QString &role); void zPosRoleChanged(const QString &role); void rotationRoleChanged(const QString &role); - Q_REVISION(1) void xPosRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void yPosRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void zPosRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void rotationRolePatternChanged(const QRegExp &pattern); + Q_REVISION(1) void xPosRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void yPosRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void zPosRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void rotationRolePatternChanged(const QRegularExpression &pattern); Q_REVISION(1) void rotationRoleReplaceChanged(const QString &replace); Q_REVISION(1) void xPosRoleReplaceChanged(const QString &replace); Q_REVISION(1) void yPosRoleReplaceChanged(const QString &replace); diff --git a/src/datavisualization/data/qitemmodelscatterdataproxy_p.h b/src/datavisualization/data/qitemmodelscatterdataproxy_p.h index a8d3c0e6..cb433a30 100644 --- a/src/datavisualization/data/qitemmodelscatterdataproxy_p.h +++ b/src/datavisualization/data/qitemmodelscatterdataproxy_p.h @@ -65,10 +65,10 @@ private: QString m_zPosRole; QString m_rotationRole; - QRegExp m_xPosRolePattern; - QRegExp m_yPosRolePattern; - QRegExp m_zPosRolePattern; - QRegExp m_rotationRolePattern; + QRegularExpression m_xPosRolePattern; + QRegularExpression m_yPosRolePattern; + QRegularExpression m_zPosRolePattern; + QRegularExpression m_rotationRolePattern; QString m_xPosRoleReplace; QString m_yPosRoleReplace; diff --git a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp index 47230326..0fa50fb2 100644 --- a/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp +++ b/src/datavisualization/data/qitemmodelsurfacedataproxy.cpp @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * If the fields of the model do not contain the data in the exact format you need, you can specify * a search pattern regular expression and a replace rule for each role to get the value in a * format you need. For more information how the replace using regular expressions works, see - * QString::replace(const QRegExp &rx, const QString &after) function documentation. Note that + * QString::replace(const QRegularExpression &rx, const QString &after) function documentation. Note that * using regular expressions has an impact on the performance, so it's more efficient to utilize * item models where doing search and replace is not necessary to get the desired values. * @@ -251,7 +251,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * The replace content to be used in conjunction with rowRolePattern. * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rowRole, rowRolePattern @@ -263,7 +263,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * The replace content to be used in conjunction with columnRolePattern. * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa columnRole, columnRolePattern @@ -275,7 +275,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * The replace content to be used in conjunction with xPosRolePattern. * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa xPosRole, xPosRolePattern @@ -287,7 +287,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * The replace content to be used in conjunction with yPosRolePattern. * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa yPosRole, yPosRolePattern @@ -299,7 +299,7 @@ QT_BEGIN_NAMESPACE_DATAVISUALIZATION * The replace content to be used in conjunction with zPosRolePattern. * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa zPosRole, zPosRolePattern @@ -770,7 +770,7 @@ int QItemModelSurfaceDataProxy::columnCategoryIndex(const QString &category) * * \sa rowRole, rowRoleReplace */ -void QItemModelSurfaceDataProxy::setRowRolePattern(const QRegExp &pattern) +void QItemModelSurfaceDataProxy::setRowRolePattern(const QRegularExpression &pattern) { if (dptr()->m_rowRolePattern != pattern) { dptr()->m_rowRolePattern = pattern; @@ -778,7 +778,7 @@ void QItemModelSurfaceDataProxy::setRowRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelSurfaceDataProxy::rowRolePattern() const +QRegularExpression QItemModelSurfaceDataProxy::rowRolePattern() const { return dptrc()->m_rowRolePattern; } @@ -795,7 +795,7 @@ QRegExp QItemModelSurfaceDataProxy::rowRolePattern() const * * \sa columnRole, columnRoleReplace */ -void QItemModelSurfaceDataProxy::setColumnRolePattern(const QRegExp &pattern) +void QItemModelSurfaceDataProxy::setColumnRolePattern(const QRegularExpression &pattern) { if (dptr()->m_columnRolePattern != pattern) { dptr()->m_columnRolePattern = pattern; @@ -803,7 +803,7 @@ void QItemModelSurfaceDataProxy::setColumnRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelSurfaceDataProxy::columnRolePattern() const +QRegularExpression QItemModelSurfaceDataProxy::columnRolePattern() const { return dptrc()->m_columnRolePattern; } @@ -820,7 +820,7 @@ QRegExp QItemModelSurfaceDataProxy::columnRolePattern() const * * \sa xPosRole, xPosRoleReplace */ -void QItemModelSurfaceDataProxy::setXPosRolePattern(const QRegExp &pattern) +void QItemModelSurfaceDataProxy::setXPosRolePattern(const QRegularExpression &pattern) { if (dptr()->m_xPosRolePattern != pattern) { dptr()->m_xPosRolePattern = pattern; @@ -828,7 +828,7 @@ void QItemModelSurfaceDataProxy::setXPosRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelSurfaceDataProxy::xPosRolePattern() const +QRegularExpression QItemModelSurfaceDataProxy::xPosRolePattern() const { return dptrc()->m_xPosRolePattern; } @@ -845,7 +845,7 @@ QRegExp QItemModelSurfaceDataProxy::xPosRolePattern() const * * \sa yPosRole, yPosRoleReplace */ -void QItemModelSurfaceDataProxy::setYPosRolePattern(const QRegExp &pattern) +void QItemModelSurfaceDataProxy::setYPosRolePattern(const QRegularExpression &pattern) { if (dptr()->m_yPosRolePattern != pattern) { dptr()->m_yPosRolePattern = pattern; @@ -853,7 +853,7 @@ void QItemModelSurfaceDataProxy::setYPosRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelSurfaceDataProxy::yPosRolePattern() const +QRegularExpression QItemModelSurfaceDataProxy::yPosRolePattern() const { return dptrc()->m_yPosRolePattern; } @@ -870,7 +870,7 @@ QRegExp QItemModelSurfaceDataProxy::yPosRolePattern() const * * \sa zPosRole, zPosRoleReplace */ -void QItemModelSurfaceDataProxy::setZPosRolePattern(const QRegExp &pattern) +void QItemModelSurfaceDataProxy::setZPosRolePattern(const QRegularExpression &pattern) { if (dptr()->m_zPosRolePattern != pattern) { dptr()->m_zPosRolePattern = pattern; @@ -878,7 +878,7 @@ void QItemModelSurfaceDataProxy::setZPosRolePattern(const QRegExp &pattern) } } -QRegExp QItemModelSurfaceDataProxy::zPosRolePattern() const +QRegularExpression QItemModelSurfaceDataProxy::zPosRolePattern() const { return dptrc()->m_zPosRolePattern; } @@ -890,7 +890,7 @@ QRegExp QItemModelSurfaceDataProxy::zPosRolePattern() const * pattern. * * Defaults to an empty string. For more information on how the search and replace using regular - * expressions works, see QString::replace(const QRegExp &rx, const QString &after) + * expressions works, see QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa rowRole, rowRolePattern @@ -916,7 +916,7 @@ QString QItemModelSurfaceDataProxy::rowRoleReplace() const * * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa columnRole, columnRolePattern @@ -942,7 +942,7 @@ QString QItemModelSurfaceDataProxy::columnRoleReplace() const * * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa xPosRole, xPosRolePattern @@ -968,7 +968,7 @@ QString QItemModelSurfaceDataProxy::xPosRoleReplace() const * * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa yPosRole, yPosRolePattern @@ -994,7 +994,7 @@ QString QItemModelSurfaceDataProxy::yPosRoleReplace() const * * Defaults to an empty string. For more information on how the search and * replace using regular expressions works, see the - * QString::replace(const QRegExp &rx, const QString &after) + * QString::replace(const QRegularExpression &rx, const QString &after) * function documentation. * * \sa zPosRole, zPosRolePattern diff --git a/src/datavisualization/data/qitemmodelsurfacedataproxy.h b/src/datavisualization/data/qitemmodelsurfacedataproxy.h index ec94c1f0..52af2d19 100644 --- a/src/datavisualization/data/qitemmodelsurfacedataproxy.h +++ b/src/datavisualization/data/qitemmodelsurfacedataproxy.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -54,11 +54,11 @@ class QT_DATAVISUALIZATION_EXPORT QItemModelSurfaceDataProxy : public QSurfaceDa Q_PROPERTY(bool useModelCategories READ useModelCategories WRITE setUseModelCategories NOTIFY useModelCategoriesChanged) Q_PROPERTY(bool autoRowCategories READ autoRowCategories WRITE setAutoRowCategories NOTIFY autoRowCategoriesChanged) Q_PROPERTY(bool autoColumnCategories READ autoColumnCategories WRITE setAutoColumnCategories NOTIFY autoColumnCategoriesChanged) - Q_PROPERTY(QRegExp rowRolePattern READ rowRolePattern WRITE setRowRolePattern NOTIFY rowRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp columnRolePattern READ columnRolePattern WRITE setColumnRolePattern NOTIFY columnRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp xPosRolePattern READ xPosRolePattern WRITE setXPosRolePattern NOTIFY xPosRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp yPosRolePattern READ yPosRolePattern WRITE setYPosRolePattern NOTIFY yPosRolePatternChanged REVISION 1) - Q_PROPERTY(QRegExp zPosRolePattern READ zPosRolePattern WRITE setZPosRolePattern NOTIFY zPosRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression rowRolePattern READ rowRolePattern WRITE setRowRolePattern NOTIFY rowRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression columnRolePattern READ columnRolePattern WRITE setColumnRolePattern NOTIFY columnRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression xPosRolePattern READ xPosRolePattern WRITE setXPosRolePattern NOTIFY xPosRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression yPosRolePattern READ yPosRolePattern WRITE setYPosRolePattern NOTIFY yPosRolePatternChanged REVISION 1) + Q_PROPERTY(QRegularExpression zPosRolePattern READ zPosRolePattern WRITE setZPosRolePattern NOTIFY zPosRolePatternChanged REVISION 1) Q_PROPERTY(QString rowRoleReplace READ rowRoleReplace WRITE setRowRoleReplace NOTIFY rowRoleReplaceChanged REVISION 1) Q_PROPERTY(QString columnRoleReplace READ columnRoleReplace WRITE setColumnRoleReplace NOTIFY columnRoleReplaceChanged REVISION 1) Q_PROPERTY(QString xPosRoleReplace READ xPosRoleReplace WRITE setXPosRoleReplace NOTIFY xPosRoleReplaceChanged REVISION 1) @@ -132,16 +132,16 @@ public: Q_INVOKABLE int rowCategoryIndex(const QString& category); Q_INVOKABLE int columnCategoryIndex(const QString& category); - void setRowRolePattern(const QRegExp &pattern); - QRegExp rowRolePattern() const; - void setColumnRolePattern(const QRegExp &pattern); - QRegExp columnRolePattern() const; - void setXPosRolePattern(const QRegExp &pattern); - QRegExp xPosRolePattern() const; - void setYPosRolePattern(const QRegExp &pattern); - QRegExp yPosRolePattern() const; - void setZPosRolePattern(const QRegExp &pattern); - QRegExp zPosRolePattern() const; + void setRowRolePattern(const QRegularExpression &pattern); + QRegularExpression rowRolePattern() const; + void setColumnRolePattern(const QRegularExpression &pattern); + QRegularExpression columnRolePattern() const; + void setXPosRolePattern(const QRegularExpression &pattern); + QRegularExpression xPosRolePattern() const; + void setYPosRolePattern(const QRegularExpression &pattern); + QRegularExpression yPosRolePattern() const; + void setZPosRolePattern(const QRegularExpression &pattern); + QRegularExpression zPosRolePattern() const; void setRowRoleReplace(const QString &replace); QString rowRoleReplace() const; @@ -169,11 +169,11 @@ Q_SIGNALS: void useModelCategoriesChanged(bool enable); void autoRowCategoriesChanged(bool enable); void autoColumnCategoriesChanged(bool enable); - Q_REVISION(1) void rowRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void columnRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void xPosRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void yPosRolePatternChanged(const QRegExp &pattern); - Q_REVISION(1) void zPosRolePatternChanged(const QRegExp &pattern); + Q_REVISION(1) void rowRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void columnRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void xPosRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void yPosRolePatternChanged(const QRegularExpression &pattern); + Q_REVISION(1) void zPosRolePatternChanged(const QRegularExpression &pattern); Q_REVISION(1) void rowRoleReplaceChanged(const QString &replace); Q_REVISION(1) void columnRoleReplaceChanged(const QString &replace); Q_REVISION(1) void xPosRoleReplaceChanged(const QString &replace); diff --git a/src/datavisualization/data/qitemmodelsurfacedataproxy_p.h b/src/datavisualization/data/qitemmodelsurfacedataproxy_p.h index 011a5221..1c8380b6 100644 --- a/src/datavisualization/data/qitemmodelsurfacedataproxy_p.h +++ b/src/datavisualization/data/qitemmodelsurfacedataproxy_p.h @@ -75,11 +75,11 @@ private: bool m_autoRowCategories; bool m_autoColumnCategories; - QRegExp m_rowRolePattern; - QRegExp m_columnRolePattern; - QRegExp m_xPosRolePattern; - QRegExp m_yPosRolePattern; - QRegExp m_zPosRolePattern; + QRegularExpression m_rowRolePattern; + QRegularExpression m_columnRolePattern; + QRegularExpression m_xPosRolePattern; + QRegularExpression m_yPosRolePattern; + QRegularExpression m_zPosRolePattern; QString m_rowRoleReplace; QString m_columnRoleReplace; diff --git a/src/datavisualization/data/scatteritemmodelhandler.cpp b/src/datavisualization/data/scatteritemmodelhandler.cpp index 67b9bb3a..7cbaa8de 100644 --- a/src/datavisualization/data/scatteritemmodelhandler.cpp +++ b/src/datavisualization/data/scatteritemmodelhandler.cpp @@ -211,10 +211,10 @@ void ScatterItemModelHandler::resolveModel() m_yPosReplace = m_proxy->yPosRoleReplace(); m_zPosReplace = m_proxy->zPosRoleReplace(); m_rotationReplace = m_proxy->rotationRoleReplace(); - m_haveXPosPattern = !m_xPosPattern.isEmpty() && m_xPosPattern.isValid(); - m_haveYPosPattern = !m_yPosPattern.isEmpty() && m_yPosPattern.isValid(); - m_haveZPosPattern = !m_zPosPattern.isEmpty() && m_zPosPattern.isValid(); - m_haveRotationPattern = !m_rotationPattern.isEmpty() && m_rotationPattern.isValid(); + m_haveXPosPattern = !m_xPosPattern.namedCaptureGroups().isEmpty() && m_xPosPattern.isValid(); + m_haveYPosPattern = !m_yPosPattern.namedCaptureGroups().isEmpty() && m_yPosPattern.isValid(); + m_haveZPosPattern = !m_zPosPattern.namedCaptureGroups().isEmpty() && m_zPosPattern.isValid(); + m_haveRotationPattern = !m_rotationPattern.namedCaptureGroups().isEmpty() && m_rotationPattern.isValid(); QHash roleHash = m_itemModel->roleNames(); m_xPosRole = roleHash.key(m_proxy->xPosRole().toLatin1(), noRoleIndex); diff --git a/src/datavisualization/data/scatteritemmodelhandler_p.h b/src/datavisualization/data/scatteritemmodelhandler_p.h index c74b2e51..41320d0c 100644 --- a/src/datavisualization/data/scatteritemmodelhandler_p.h +++ b/src/datavisualization/data/scatteritemmodelhandler_p.h @@ -70,10 +70,10 @@ private: int m_yPosRole; int m_zPosRole; int m_rotationRole; - QRegExp m_xPosPattern; - QRegExp m_yPosPattern; - QRegExp m_zPosPattern; - QRegExp m_rotationPattern; + QRegularExpression m_xPosPattern; + QRegularExpression m_yPosPattern; + QRegularExpression m_zPosPattern; + QRegularExpression m_rotationPattern; QString m_xPosReplace; QString m_yPosReplace; QString m_zPosReplace; diff --git a/src/datavisualization/data/surfaceitemmodelhandler.cpp b/src/datavisualization/data/surfaceitemmodelhandler.cpp index 122499be..7121d38a 100644 --- a/src/datavisualization/data/surfaceitemmodelhandler.cpp +++ b/src/datavisualization/data/surfaceitemmodelhandler.cpp @@ -123,8 +123,8 @@ void SurfaceItemModelHandler::resolveModel() } // Position patterns can be reused on single item changes, so store them to member variables. - QRegExp rowPattern(m_proxy->rowRolePattern()); - QRegExp colPattern(m_proxy->columnRolePattern()); + QRegularExpression rowPattern(m_proxy->rowRolePattern()); + QRegularExpression colPattern(m_proxy->columnRolePattern()); m_xPosPattern = m_proxy->xPosRolePattern(); m_yPosPattern = m_proxy->yPosRolePattern(); m_zPosPattern = m_proxy->zPosRolePattern(); @@ -133,11 +133,11 @@ void SurfaceItemModelHandler::resolveModel() m_xPosReplace = m_proxy->xPosRoleReplace(); m_yPosReplace = m_proxy->yPosRoleReplace(); m_zPosReplace = m_proxy->zPosRoleReplace(); - bool haveRowPattern = !rowPattern.isEmpty() && rowPattern.isValid(); - bool haveColPattern = !colPattern.isEmpty() && colPattern.isValid(); - m_haveXPosPattern = !m_xPosPattern.isEmpty() && m_xPosPattern.isValid(); - m_haveYPosPattern = !m_yPosPattern.isEmpty() && m_yPosPattern.isValid(); - m_haveZPosPattern = !m_zPosPattern.isEmpty() && m_zPosPattern.isValid(); + bool haveRowPattern = !rowPattern.namedCaptureGroups().isEmpty() && rowPattern.isValid(); + bool haveColPattern = !colPattern.namedCaptureGroups().isEmpty() && colPattern.isValid(); + m_haveXPosPattern = !m_xPosPattern.namedCaptureGroups().isEmpty() && m_xPosPattern.isValid(); + m_haveYPosPattern = !m_yPosPattern.namedCaptureGroups().isEmpty() && m_yPosPattern.isValid(); + m_haveZPosPattern = !m_zPosPattern.namedCaptureGroups().isEmpty() && m_zPosPattern.isValid(); QHash roleHash = m_itemModel->roleNames(); diff --git a/src/datavisualization/data/surfaceitemmodelhandler_p.h b/src/datavisualization/data/surfaceitemmodelhandler_p.h index b5d83096..21dfb0eb 100644 --- a/src/datavisualization/data/surfaceitemmodelhandler_p.h +++ b/src/datavisualization/data/surfaceitemmodelhandler_p.h @@ -64,9 +64,9 @@ protected: int m_xPosRole; int m_yPosRole; int m_zPosRole; - QRegExp m_xPosPattern; - QRegExp m_yPosPattern; - QRegExp m_zPosPattern; + QRegularExpression m_xPosPattern; + QRegularExpression m_yPosPattern; + QRegularExpression m_zPosPattern; QString m_xPosReplace; QString m_yPosReplace; QString m_zPosReplace; diff --git a/src/datavisualization/engine/abstract3drenderer.cpp b/src/datavisualization/engine/abstract3drenderer.cpp index ef77dc92..fd81e930 100644 --- a/src/datavisualization/engine/abstract3drenderer.cpp +++ b/src/datavisualization/engine/abstract3drenderer.cpp @@ -132,7 +132,7 @@ Abstract3DRenderer::Abstract3DRenderer(Abstract3DController *controller) // Discard warnings about deprecated functions QtMessageHandler handler = qInstallMessageHandler(discardDebugMsgs); - m_funcs_2_1 = QOpenGLContext::currentContext()->versionFunctions(); + m_funcs_2_1 = new QOpenGLFunctions_2_1; if (m_funcs_2_1) m_funcs_2_1->initializeOpenGLFunctions(); @@ -192,6 +192,8 @@ Abstract3DRenderer::~Abstract3DRenderer() m_axisCacheX.clearLabels(); m_axisCacheY.clearLabels(); m_axisCacheZ.clearLabels(); + + delete m_funcs_2_1; } void Abstract3DRenderer::contextCleanup() diff --git a/src/datavisualization/engine/abstract3drenderer_p.h b/src/datavisualization/engine/abstract3drenderer_p.h index affd0d69..4155a551 100644 --- a/src/datavisualization/engine/abstract3drenderer_p.h +++ b/src/datavisualization/engine/abstract3drenderer_p.h @@ -42,7 +42,7 @@ #include #if !defined(QT_OPENGL_ES_2) -# include +# include #endif #include "datavisualizationglobal_p.h" #include "abstract3dcontroller_p.h" @@ -334,7 +334,7 @@ protected: QLocale m_locale; #if !defined(QT_OPENGL_ES_2) - QOpenGLFunctions_2_1 *m_funcs_2_1; // Not owned + QOpenGLFunctions_2_1 *m_funcs_2_1; #endif QPointer m_context; // Not owned bool m_isOpenGLES; diff --git a/src/datavisualization/global/datavisualizationglobal_p.h b/src/datavisualization/global/datavisualizationglobal_p.h index 6d71255e..7c1b7815 100644 --- a/src/datavisualization/global/datavisualizationglobal_p.h +++ b/src/datavisualization/global/datavisualizationglobal_p.h @@ -42,6 +42,7 @@ #include "qdatavisualizationglobal.h" #include +#include #include #include #include diff --git a/src/datavisualization/utils/texturehelper.cpp b/src/datavisualization/utils/texturehelper.cpp index 0e66459c..4ff56cb3 100644 --- a/src/datavisualization/utils/texturehelper.cpp +++ b/src/datavisualization/utils/texturehelper.cpp @@ -47,8 +47,7 @@ TextureHelper::TextureHelper() // Discard warnings about deprecated functions QtMessageHandler handler = qInstallMessageHandler(discardDebugMsgs); - m_openGlFunctions_2_1 = - QOpenGLContext::currentContext()->versionFunctions(); + m_openGlFunctions_2_1 = new QOpenGLFunctions_2_1; if (m_openGlFunctions_2_1) m_openGlFunctions_2_1->initializeOpenGLFunctions(); @@ -63,6 +62,7 @@ TextureHelper::TextureHelper() TextureHelper::~TextureHelper() { + delete m_openGlFunctions_2_1; } GLuint TextureHelper::create2DTexture(const QImage &image, bool useTrilinearFiltering, @@ -328,7 +328,7 @@ GLuint TextureHelper::createDepthTextureFrameBuffer(const QSize &size, GLuint &f // Attach texture to depth attachment glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthtextureid, 0); - m_openGlFunctions_2_1->glDrawBuffer(GL_NONE); + m_openGlFunctions_2_1->glDrawBuffers(0, GL_NONE); m_openGlFunctions_2_1->glReadBuffer(GL_NONE); // Verify that the frame buffer is complete diff --git a/src/datavisualization/utils/texturehelper_p.h b/src/datavisualization/utils/texturehelper_p.h index fac32a42..9ef68d74 100644 --- a/src/datavisualization/utils/texturehelper_p.h +++ b/src/datavisualization/utils/texturehelper_p.h @@ -45,7 +45,7 @@ #include #if !defined(QT_OPENGL_ES_2) // 3D Textures are not supported by ES set -# include +# include #endif QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -78,7 +78,7 @@ class TextureHelper : protected QOpenGLFunctions QRgb qt_gl_convertToGLFormatHelper(QRgb src_pixel, GLenum texture_format); #if !defined(QT_OPENGL_ES_2) - QOpenGLFunctions_2_1 *m_openGlFunctions_2_1; // Not owned + QOpenGLFunctions_2_1 *m_openGlFunctions_2_1; #endif friend class Bars3DRenderer; friend class Surface3DRenderer; diff --git a/src/datavisualization/utils/utils.cpp b/src/datavisualization/utils/utils.cpp index e80058db..2503ad2b 100644 --- a/src/datavisualization/utils/utils.cpp +++ b/src/datavisualization/utils/utils.cpp @@ -33,6 +33,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE_DATAVISUALIZATION @@ -217,24 +218,28 @@ QImage Utils::getGradientImage(QLinearGradient &gradient) Utils::ParamType Utils::preParseFormat(const QString &format, QString &preStr, QString &postStr, int &precision, char &formatSpec) { - static QRegExp formatMatcher(QStringLiteral("^([^%]*)%([\\-\\+#\\s\\d\\.lhjztL]*)([dicuoxfegXFEG])(.*)$")); - static QRegExp precisionMatcher(QStringLiteral("\\.(\\d+)")); + static QRegularExpression formatMatcher(QStringLiteral("^([^%]*)%([\\-\\+#\\s\\d\\.lhjztL]*)([dicuoxfegXFEG])(.*)$")); + static QRegularExpression precisionMatcher(QStringLiteral("\\.(\\d+)")); Utils::ParamType retVal; - if (formatMatcher.indexIn(format, 0) != -1) { - preStr = formatMatcher.cap(1); + QRegularExpressionMatch formatMatch = formatMatcher.match(format, 0); + + if (formatMatch.hasMatch()) { + preStr = formatMatch.captured(1); // Six and 'g' are defaults in Qt API precision = 6; - if (!formatMatcher.cap(2).isEmpty()) { - if (precisionMatcher.indexIn(formatMatcher.cap(2), 0) != -1) - precision = precisionMatcher.cap(1).toInt(); + if (!formatMatch.captured(2).isEmpty()) { + QRegularExpressionMatch precisionMatch = precisionMatcher.match(formatMatch.captured(2), + 0); + if (precisionMatch.hasMatch()) + precision = precisionMatch.captured(1).toInt(); } - if (formatMatcher.cap(3).isEmpty()) + if (formatMatch.captured(3).isEmpty()) formatSpec = 'g'; else - formatSpec = formatMatcher.cap(3).at(0).toLatin1(); - postStr = formatMatcher.cap(4); + formatSpec = formatMatch.captured(3).at(0).toLatin1(); + postStr = formatMatch.captured(4); retVal = mapFormatCharToParamType(formatSpec); } else { retVal = ParamTypeUnknown; diff --git a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp index dfeee506..18cd746e 100644 --- a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp @@ -149,20 +149,20 @@ void tst_proxy::initialProperties() QCOMPARE(m_proxy->autoRowCategories(), true); QCOMPARE(m_proxy->columnCategories(), QStringList()); QCOMPARE(m_proxy->columnRole(), QString()); - QCOMPARE(m_proxy->columnRolePattern(), QRegExp()); + QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->columnRoleReplace(), QString()); QVERIFY(!m_proxy->itemModel()); QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelBarDataProxy::MMBLast); QCOMPARE(m_proxy->rotationRole(), QString()); - QCOMPARE(m_proxy->rotationRolePattern(), QRegExp()); + QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->rotationRoleReplace(), QString()); QCOMPARE(m_proxy->rowCategories(), QStringList()); QCOMPARE(m_proxy->rowRole(), QString()); - QCOMPARE(m_proxy->rowRolePattern(), QRegExp()); + QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->rowRoleReplace(), QString()); QCOMPARE(m_proxy->useModelCategories(), false); QCOMPARE(m_proxy->valueRole(), QString()); - QCOMPARE(m_proxy->valueRolePattern(), QRegExp()); + QCOMPARE(m_proxy->valueRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->valueRoleReplace(), QString()); QCOMPARE(m_proxy->columnLabels().count(), 0); @@ -183,40 +183,40 @@ void tst_proxy::initializeProperties() m_proxy->setAutoRowCategories(false); m_proxy->setColumnCategories(QStringList() << "col1" << "col2"); m_proxy->setColumnRole("column"); - m_proxy->setColumnRolePattern(QRegExp("/^.*-(\\d\\d)$/")); + m_proxy->setColumnRolePattern(QRegularExpression("/^.*-(\\d\\d)$/")); m_proxy->setColumnRoleReplace("\\\\1"); m_proxy->setItemModel(table.model()); m_proxy->setMultiMatchBehavior(QItemModelBarDataProxy::MMBAverage); m_proxy->setRotationRole("rotation"); - m_proxy->setRotationRolePattern(QRegExp("/-/")); + m_proxy->setRotationRolePattern(QRegularExpression("/-/")); m_proxy->setRotationRoleReplace("\\\\1"); m_proxy->setRowCategories(QStringList() << "row1" << "row2"); m_proxy->setRowRole("row"); - m_proxy->setRowRolePattern(QRegExp("/^(\\d\\d\\d\\d).*$/")); + m_proxy->setRowRolePattern(QRegularExpression("/^(\\d\\d\\d\\d).*$/")); m_proxy->setRowRoleReplace("\\\\1"); m_proxy->setUseModelCategories(true); m_proxy->setValueRole("value"); - m_proxy->setValueRolePattern(QRegExp("/-/")); + m_proxy->setValueRolePattern(QRegularExpression("/-/")); m_proxy->setValueRoleReplace("\\\\1"); QCOMPARE(m_proxy->autoColumnCategories(), false); QCOMPARE(m_proxy->autoRowCategories(), false); QCOMPARE(m_proxy->columnCategories().count(), 2); QCOMPARE(m_proxy->columnRole(), QString("column")); - QCOMPARE(m_proxy->columnRolePattern(), QRegExp("/^.*-(\\d\\d)$/")); + QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/")); QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1")); QVERIFY(m_proxy->itemModel()); QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelBarDataProxy::MMBAverage); QCOMPARE(m_proxy->rotationRole(), QString("rotation")); - QCOMPARE(m_proxy->rotationRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->rotationRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->rowCategories().count(), 2); QCOMPARE(m_proxy->rowRole(), QString("row")); - QCOMPARE(m_proxy->rowRolePattern(), QRegExp("/^(\\d\\d\\d\\d).*$/")); + QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/")); QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->useModelCategories(), true); QCOMPARE(m_proxy->valueRole(), QString("value")); - QCOMPARE(m_proxy->valueRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->valueRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->valueRoleReplace(), QString("\\\\1")); } @@ -247,11 +247,11 @@ void tst_proxy::multiMatch() m_proxy->setItemModel(table.model()); m_proxy->setRowRole(table.model()->roleNames().value(Qt::DisplayRole)); m_proxy->setColumnRole(table.model()->roleNames().value(Qt::DisplayRole)); - m_proxy->setRowRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setRowRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setRowRoleReplace(QStringLiteral("\\2")); - m_proxy->setValueRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setValueRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setValueRoleReplace(QStringLiteral("\\3")); - m_proxy->setColumnRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setColumnRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setColumnRoleReplace(QStringLiteral("\\1")); QBar3DSeries *series = new QBar3DSeries(m_proxy); diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp index 55fb2333..6d0d7ed5 100644 --- a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp @@ -109,16 +109,16 @@ void tst_proxy::initialProperties() QVERIFY(!m_proxy->itemModel()); QCOMPARE(m_proxy->rotationRole(), QString()); - QCOMPARE(m_proxy->rotationRolePattern(), QRegExp()); + QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->rotationRoleReplace(), QString()); QCOMPARE(m_proxy->xPosRole(), QString()); - QCOMPARE(m_proxy->xPosRolePattern(), QRegExp()); + QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->xPosRoleReplace(), QString()); QCOMPARE(m_proxy->yPosRole(), QString()); - QCOMPARE(m_proxy->yPosRolePattern(), QRegExp()); + QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->yPosRoleReplace(), QString()); QCOMPARE(m_proxy->zPosRole(), QString()); - QCOMPARE(m_proxy->zPosRolePattern(), QRegExp()); + QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->zPosRoleReplace(), QString()); QCOMPARE(m_proxy->itemCount(), 0); @@ -135,30 +135,30 @@ void tst_proxy::initializeProperties() m_proxy->setItemModel(table.model()); m_proxy->setRotationRole("rotation"); - m_proxy->setRotationRolePattern(QRegExp("/-/")); + m_proxy->setRotationRolePattern(QRegularExpression("/-/")); m_proxy->setRotationRoleReplace("\\\\1"); m_proxy->setXPosRole("X"); - m_proxy->setXPosRolePattern(QRegExp("/-/")); + m_proxy->setXPosRolePattern(QRegularExpression("/-/")); m_proxy->setXPosRoleReplace("\\\\1"); m_proxy->setYPosRole("Y"); - m_proxy->setYPosRolePattern(QRegExp("/-/")); + m_proxy->setYPosRolePattern(QRegularExpression("/-/")); m_proxy->setYPosRoleReplace("\\\\1"); m_proxy->setZPosRole("Z"); - m_proxy->setZPosRolePattern(QRegExp("/-/")); + m_proxy->setZPosRolePattern(QRegularExpression("/-/")); m_proxy->setZPosRoleReplace("\\\\1"); QVERIFY(m_proxy->itemModel()); QCOMPARE(m_proxy->rotationRole(), QString("rotation")); - QCOMPARE(m_proxy->rotationRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->rotationRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->xPosRole(), QString("X")); - QCOMPARE(m_proxy->xPosRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->xPosRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->yPosRole(), QString("Y")); - QCOMPARE(m_proxy->yPosRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->yPosRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->zPosRole(), QString("Z")); - QCOMPARE(m_proxy->zPosRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->zPosRoleReplace(), QString("\\\\1")); } @@ -184,11 +184,11 @@ void tst_proxy::addModel() m_proxy->setItemModel(table.model()); m_proxy->setXPosRole(table.model()->roleNames().value(Qt::DisplayRole)); m_proxy->setZPosRole(table.model()->roleNames().value(Qt::DisplayRole)); - m_proxy->setXPosRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setXPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setXPosRoleReplace(QStringLiteral("\\2")); - m_proxy->setYPosRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setYPosRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setYPosRoleReplace(QStringLiteral("\\3")); - m_proxy->setZPosRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setZPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setZPosRoleReplace(QStringLiteral("\\1")); QScatter3DSeries *series = new QScatter3DSeries(m_proxy); diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp index eb984c1a..8f573ccb 100644 --- a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp @@ -155,23 +155,23 @@ void tst_proxy::initialProperties() QCOMPARE(m_proxy->autoRowCategories(), true); QCOMPARE(m_proxy->columnCategories(), QStringList()); QCOMPARE(m_proxy->columnRole(), QString()); - QCOMPARE(m_proxy->columnRolePattern(), QRegExp()); + QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->columnRoleReplace(), QString()); QVERIFY(!m_proxy->itemModel()); QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelSurfaceDataProxy::MMBLast); QCOMPARE(m_proxy->rowCategories(), QStringList()); QCOMPARE(m_proxy->rowRole(), QString()); - QCOMPARE(m_proxy->rowRolePattern(), QRegExp()); + QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->rowRoleReplace(), QString()); QCOMPARE(m_proxy->useModelCategories(), false); QCOMPARE(m_proxy->xPosRole(), QString()); - QCOMPARE(m_proxy->xPosRolePattern(), QRegExp()); + QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->xPosRoleReplace(), QString()); QCOMPARE(m_proxy->yPosRole(), QString()); - QCOMPARE(m_proxy->yPosRolePattern(), QRegExp()); + QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->yPosRoleReplace(), QString()); QCOMPARE(m_proxy->zPosRole(), QString()); - QCOMPARE(m_proxy->zPosRolePattern(), QRegExp()); + QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->zPosRoleReplace(), QString()); QCOMPARE(m_proxy->columnCount(), 0); @@ -191,46 +191,46 @@ void tst_proxy::initializeProperties() m_proxy->setAutoRowCategories(false); m_proxy->setColumnCategories(QStringList() << "col1" << "col2"); m_proxy->setColumnRole("column"); - m_proxy->setColumnRolePattern(QRegExp("/^.*-(\\d\\d)$/")); + m_proxy->setColumnRolePattern(QRegularExpression("/^.*-(\\d\\d)$/")); m_proxy->setColumnRoleReplace("\\\\1"); m_proxy->setItemModel(table.model()); m_proxy->setMultiMatchBehavior(QItemModelSurfaceDataProxy::MMBAverage); m_proxy->setRowCategories(QStringList() << "row1" << "row2"); m_proxy->setRowRole("row"); - m_proxy->setRowRolePattern(QRegExp("/^(\\d\\d\\d\\d).*$/")); + m_proxy->setRowRolePattern(QRegularExpression("/^(\\d\\d\\d\\d).*$/")); m_proxy->setRowRoleReplace("\\\\1"); m_proxy->setUseModelCategories(true); m_proxy->setXPosRole("X"); - m_proxy->setXPosRolePattern(QRegExp("/-/")); + m_proxy->setXPosRolePattern(QRegularExpression("/-/")); m_proxy->setXPosRoleReplace("\\\\1"); m_proxy->setYPosRole("Y"); - m_proxy->setYPosRolePattern(QRegExp("/-/")); + m_proxy->setYPosRolePattern(QRegularExpression("/-/")); m_proxy->setYPosRoleReplace("\\\\1"); m_proxy->setZPosRole("Z"); - m_proxy->setZPosRolePattern(QRegExp("/-/")); + m_proxy->setZPosRolePattern(QRegularExpression("/-/")); m_proxy->setZPosRoleReplace("\\\\1"); QCOMPARE(m_proxy->autoColumnCategories(), false); QCOMPARE(m_proxy->autoRowCategories(), false); QCOMPARE(m_proxy->columnCategories().count(), 2); QCOMPARE(m_proxy->columnRole(), QString("column")); - QCOMPARE(m_proxy->columnRolePattern(), QRegExp("/^.*-(\\d\\d)$/")); + QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/")); QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1")); QVERIFY(m_proxy->itemModel()); QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelSurfaceDataProxy::MMBAverage); QCOMPARE(m_proxy->rowCategories().count(), 2); QCOMPARE(m_proxy->rowRole(), QString("row")); - QCOMPARE(m_proxy->rowRolePattern(), QRegExp("/^(\\d\\d\\d\\d).*$/")); + QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/")); QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->useModelCategories(), true); QCOMPARE(m_proxy->xPosRole(), QString("X")); - QCOMPARE(m_proxy->xPosRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->xPosRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->yPosRole(), QString("Y")); - QCOMPARE(m_proxy->yPosRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->yPosRoleReplace(), QString("\\\\1")); QCOMPARE(m_proxy->zPosRole(), QString("Z")); - QCOMPARE(m_proxy->zPosRolePattern(), QRegExp("/-/")); + QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->zPosRoleReplace(), QString("\\\\1")); } @@ -264,11 +264,11 @@ void tst_proxy::multiMatch() m_proxy->setItemModel(table.model()); m_proxy->setRowRole(table.model()->roleNames().value(Qt::DisplayRole)); m_proxy->setColumnRole(table.model()->roleNames().value(Qt::DisplayRole)); - m_proxy->setRowRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setRowRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setRowRoleReplace(QStringLiteral("\\2")); - m_proxy->setYPosRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setYPosRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setYPosRoleReplace(QStringLiteral("\\3")); - m_proxy->setColumnRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + m_proxy->setColumnRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setColumnRoleReplace(QStringLiteral("\\1")); QSurface3DSeries *series = new QSurface3DSeries(m_proxy); diff --git a/tests/manual/itemmodeltest/main.cpp b/tests/manual/itemmodeltest/main.cpp index 90a2e74e..8e98e209 100644 --- a/tests/manual/itemmodeltest/main.cpp +++ b/tests/manual/itemmodeltest/main.cpp @@ -288,17 +288,17 @@ int main(int argc, char **argv) barProxy->setUseModelCategories(true); surfaceProxy->setUseModelCategories(true); barProxy->setRotationRole(tableWidget->model()->roleNames().value(Qt::DisplayRole)); - barProxy->setValueRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); - barProxy->setRotationRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)\\d*\\/\\d*([\\.\\,]?)\\d*(\\/)(\\d*[\\.\\,]?\\d*)$"))); + barProxy->setValueRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); + barProxy->setRotationRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)\\d*\\/\\d*([\\.\\,]?)\\d*(\\/)(\\d*[\\.\\,]?\\d*)$"))); barProxy->setValueRoleReplace(QStringLiteral("\\4")); barProxy->setRotationRoleReplace(QStringLiteral("\\5")); surfaceProxy->setXPosRole(tableWidget->model()->roleNames().value(Qt::DisplayRole)); surfaceProxy->setZPosRole(tableWidget->model()->roleNames().value(Qt::DisplayRole)); - surfaceProxy->setXPosRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + surfaceProxy->setXPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); surfaceProxy->setXPosRoleReplace(QStringLiteral("\\2")); - surfaceProxy->setYPosRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); + surfaceProxy->setYPosRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); surfaceProxy->setYPosRoleReplace(QStringLiteral("\\3")); - surfaceProxy->setZPosRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); + surfaceProxy->setZPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); surfaceProxy->setZPosRoleReplace(QStringLiteral("\\1")); QBar3DSeries *barSeries = new QBar3DSeries(barProxy); QSurface3DSeries *surfaceSeries = new QSurface3DSeries(surfaceProxy); -- cgit v1.2.3