Skip to content

Commit 0c0a7f6

Browse files
committed
remove qt5core dependency
1 parent 12b6fd4 commit 0c0a7f6

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

DFTFringe.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DEFINES += QAPPLICATION_CLASS=QApplication
1414

1515
TEMPLATE = app
1616

17-
QT += charts concurrent core core5compat datavisualization gui network opengl widgets xml
17+
QT += charts concurrent core datavisualization gui network opengl widgets xml
1818

1919
qtHaveModule(printsupport): QT += printsupport
2020

standastigwizard.cpp

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <QDebug>
2323
#include <counterrotationdlg.h>
2424
#include <QString>
25-
#include <QRegExp>
25+
#include <QRegularExpression>
2626
#include "surfacemanager.h"
2727

2828
QString AstigReportTitle = "";
@@ -304,22 +304,36 @@ void define_input::compute(){
304304
emit computeStandAstig( this, rotationList);
305305
}
306306

307-
QString getNumberFromQString(const QString &xString)
308-
{
309307

310-
QStringList l = xString.split("/");
311-
QString fn = l[l.size()-1];
312-
QRegExp xRegExp("(\\d+([\\.p]\\d+)?)");
313-
xRegExp.indexIn(fn);
314-
QString c = xRegExp.cap();
315-
c.replace("p",".");
316-
if (c == ""){
317-
xRegExp.indexIn(l[l.size()-2]);
318-
c = xRegExp.cap();
319-
c.replace("p",".");
320-
}
321-
return c;
308+
/**
309+
* @brief Extracts a numeric value from a given QString, replacing 'p' with '.' for decimal representation.
310+
*
311+
* This function splits the input string by '/' and attempts to find a number (integer or decimal)
312+
* in the last segment. If not found, it checks the second-to-last segment. The number can contain
313+
* digits and may use 'p' as a decimal separator, which will be replaced by '.' in the output.
314+
*
315+
* @param xString The input QString from which to extract the number.
316+
* @return QString The extracted number as a string, or an empty string if no number is found.
317+
*/
318+
QString getNumberFromQString(const QString &xString) {
319+
QStringList l = xString.split("/");
320+
QString fn = l[l.size()-1];
321+
QRegularExpression xRegExp("(\\d+(?:[\\.p]\\d+)?)");
322+
QRegularExpressionMatch match = xRegExp.match(fn);
323+
QString c;
324+
if(match.hasMatch()) {
325+
c = match.captured(1).replace("p",".");
326+
} else {
327+
match = xRegExp.match(l[l.size()-2]);
328+
if(match.hasMatch()) {
329+
c = match.captured(1).replace("p",".");
330+
} else {
331+
c = "";
332+
}
333+
}
334+
return c;
322335
}
336+
323337
void define_input::browse(){
324338

325339
QStringList fileNames = QFileDialog::getOpenFileNames(this,

0 commit comments

Comments
 (0)