Match any even if there are unnecessary characters before or after the geometry string
Fix whitespacesmaster
parent
217979e55b
commit
4a3df34641
|
@ -72,8 +72,8 @@ Geometry::Format Geometry::set(QString str)
|
|||
}
|
||||
else if((match = cornerDimension.match(str)).hasMatch()){
|
||||
qDebug()<<"format is CornerDimensions";
|
||||
corner[0][0] = match.captured(1).toInt();
|
||||
corner[0][1] = match.captured(2).toInt();
|
||||
corner[0][0] = match.captured(1).toInt();
|
||||
corner[0][1] = match.captured(2).toInt();
|
||||
dimension[0] = match.captured(3).toInt();
|
||||
dimension[1] = match.captured(4).toInt();
|
||||
computeCenter();
|
||||
|
|
|
@ -49,10 +49,10 @@ public:
|
|||
void setCorners(int c0x, int c0y, int c1x, int c1y);
|
||||
QString getString(Geometry::Format format = Geometry::FormatNone);
|
||||
private:
|
||||
QRegularExpression corners = QRegularExpression("^(-?\\d*),(-?\\d*):(-?\\d*),(-?\\d*)$");
|
||||
QRegularExpression centerDimension = QRegularExpression("^(-?\\d*),(-?\\d*):-?(\\d*)x-?(\\d*)$");
|
||||
QRegularExpression cornerDimension = QRegularExpression("^(-?\\d*)[,x](-?\\d*)[+-](-?\\d*)[+-](-?\\d*)$");
|
||||
QRegularExpression centerDimensionSimple = QRegularExpression("^(\\d*)x(\\d*)$");
|
||||
QRegularExpression corners = QRegularExpression("(-?\\d*),(-?\\d*):(-?\\d*),(-?\\d*)");
|
||||
QRegularExpression centerDimension = QRegularExpression("(-?\\d*),(-?\\d*):-?(\\d*)x-?(\\d*)");
|
||||
QRegularExpression cornerDimension = QRegularExpression("(-?\\d*)[,x](-?\\d*)[+-](-?\\d*)[+-](-?\\d*)");
|
||||
QRegularExpression centerDimensionSimple = QRegularExpression("(\\d*)x(\\d*)");
|
||||
bool adjustCorners(void);
|
||||
void computeCorner0(void);
|
||||
void computeCorner1(void);
|
||||
|
|
Loading…
Reference in New Issue