EvalSpinBox new "calculationVisible" property
This commit is contained in:
@@ -30,6 +30,7 @@ EvalSpinBox::EvalSpinBox(QWidget * parent): QAbstractSpinBox(parent) {
|
||||
cw->setToolTip(tr("Clear"));
|
||||
cw->hide();
|
||||
cw_visible = false;
|
||||
calc_visible = true;
|
||||
//lineEdit()->setStyleSheet("color: darkgreen;");
|
||||
//lineEdit()->setText(eval.expression() + " -> " + QString::number(value(), 'G', 10));
|
||||
cw->installEventFilter(this);
|
||||
@@ -277,7 +278,8 @@ void EvalSpinBox::focusOutEvent(QFocusEvent * event) {
|
||||
label->setText("<html><head/><body><p><span style=\"color:#005500;\">-> " + QString::number(value(), 'G', 10) + "</span></p></body></html>");
|
||||
else
|
||||
label->setText("");
|
||||
label->show();
|
||||
if (calc_visible)
|
||||
label->show();
|
||||
lineEdit()->blockSignals(true);
|
||||
if (!eval->isCorrect()) lineEdit()->setStyleSheet("color: darkred;");
|
||||
else status->hide();
|
||||
@@ -338,3 +340,9 @@ void EvalSpinBox::setClearButtonVisible(bool visible) {
|
||||
cw->setVisible((eval->expression() != dt || (dt.isEmpty() && eval->expression() == "0")) && cw_visible);
|
||||
resizeIcons();
|
||||
}
|
||||
|
||||
|
||||
void EvalSpinBox::setCalculationVisible(bool visible) {
|
||||
calc_visible = visible;
|
||||
setExpression_();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user