void ResultDisplay::append(const QString& expression, Quantity& value)
{
    ++m_count;

    appendPlainText(expression);
    if (!value.isNan())
        appendPlainText(QLatin1String("= ") + NumberFormatter::format(value));
    appendPlainText(QLatin1String(""));
}
void ResultDisplay::refresh()
{
    clear();
    QList<HistoryEntry> history = Evaluator::instance()->session()->historyToList();
    m_count = history.count();

    for(int i=0; i<m_count; ++i) {
        QString expression = history[i].expr();
        Quantity value = history[i].result();
        appendPlainText(expression);
        if (!value.isNan())
            appendPlainText(QLatin1String("= ") + NumberFormatter::format(value));
        appendPlainText(QLatin1String(""));
    }

}