Using return to write the logBook in UnitsCalculator

This commit is contained in:
jriegel 2013-11-29 18:43:11 +01:00
parent f2ebb0813e
commit ae3c1704c9
2 changed files with 8 additions and 0 deletions

View File

@ -48,7 +48,9 @@ DlgUnitsCalculator::DlgUnitsCalculator( QWidget* parent, Qt::WFlags fl )
this->setAttribute(Qt::WA_DeleteOnClose);
connect(this->ValueInput, SIGNAL(valueChanged(Base::Quantity)), this, SLOT(valueChanged(Base::Quantity)));
connect(this->ValueInput, SIGNAL(returnPressed () ), this, SLOT(returnPressed()));
connect(this->UnitInput, SIGNAL(valueChanged(Base::Quantity)), this, SLOT(unitValueChanged(Base::Quantity)));
connect(this->UnitInput, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
connect(this->pushButton_Help, SIGNAL(clicked()), this, SLOT(help()));
connect(this->pushButton_Close, SIGNAL(clicked()), this, SLOT(accept()));
@ -131,6 +133,10 @@ void DlgUnitsCalculator::help(void)
//TODO: call help page Std_UnitsCalculator
}
void DlgUnitsCalculator::returnPressed(void)
{
this->textEdit->append(this->ValueInput->text() + QString::fromAscii(" = ") + this->ValueOutput->text());
}

View File

@ -51,6 +51,7 @@ protected Q_SLOTS:
void copy(void);
void help(void);
void returnPressed(void);
void parseError(const QString& errorText);
@ -58,6 +59,7 @@ private:
Base::Quantity actValue;
Base::Quantity actUnit;
};
} // namespace Dialog