evalspinbox wheel
This commit is contained in:
@@ -820,6 +820,7 @@ void Graphic::exportGraphics(QString filename) {
|
|||||||
QMessageBox::critical(this, tr("Export graphics"), tr("Can`t open file \"%1\"!").arg(filename));
|
QMessageBox::critical(this, tr("Export graphics"), tr("Can`t open file \"%1\"!").arg(filename));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||||
f.resize(0);
|
f.resize(0);
|
||||||
QTextStream ts(&f);
|
QTextStream ts(&f);
|
||||||
ts << "#";
|
ts << "#";
|
||||||
@@ -854,6 +855,7 @@ void Graphic::exportGraphics(QString filename) {
|
|||||||
if (has_data)
|
if (has_data)
|
||||||
ts << line;
|
ts << line;
|
||||||
}
|
}
|
||||||
|
QApplication::restoreOverrideCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -395,6 +395,9 @@
|
|||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ void EvalSpinBox::stepByDouble(double steps) {
|
|||||||
if (eval->check(t)) {
|
if (eval->check(t)) {
|
||||||
t = eval->expression();
|
t = eval->expression();
|
||||||
#if QT_VERSION_MAJOR <= 5
|
#if QT_VERSION_MAJOR <= 5
|
||||||
/* QRegExp re("[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)");
|
QRegExp re("[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)");
|
||||||
int pos = 0;
|
int pos = 0;
|
||||||
if ((pos = re.indexIn(t)) != -1) {
|
if ((pos = re.indexIn(t)) != -1) {
|
||||||
double v = t.mid(pos, re.matchedLength()).toDouble();
|
double v = t.mid(pos, re.matchedLength()).toDouble();
|
||||||
@@ -326,9 +326,19 @@ void EvalSpinBox::stepByDouble(double steps) {
|
|||||||
double v = steps;
|
double v = steps;
|
||||||
t = QString::number(v) + t;
|
t = QString::number(v) + t;
|
||||||
}
|
}
|
||||||
#else*/
|
#else
|
||||||
QRegularExpression re("[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)");
|
QRegularExpression re("[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)");
|
||||||
/// TODO andrey
|
QRegularExpressionMatchIterator i = re.globalMatch(t);
|
||||||
|
if (i.hasNext()) {
|
||||||
|
QRegularExpressionMatch match = i.next();
|
||||||
|
double v = t.mid(match.capturedStart(), match.capturedLength()).toDouble();
|
||||||
|
v += steps;
|
||||||
|
t.remove(match.capturedStart(), match.capturedLength());
|
||||||
|
t.insert(match.capturedStart(), QString::number(v));
|
||||||
|
} else {
|
||||||
|
double v = steps;
|
||||||
|
t = QString::number(v) + t;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
eval->check(t);
|
eval->check(t);
|
||||||
lineEdit()->setText(eval->expression());
|
lineEdit()->setText(eval->expression());
|
||||||
|
|||||||
Reference in New Issue
Block a user