view qt-interpreter.h @ 7:04867eba6428

function objects and signals/slots for errors and results
author John W. Eaton <jwe@octave.org>
date Thu, 23 May 2019 09:27:09 -0400
parents 1b575145197e
children 894be158b32d
line wrap: on
line source

#if ! defined (calc_qt_interpreter_h)
#define calc_qt_interpreter_h 1

#include <QObject>
#include <QString>

#include "interpreter.h"

namespace calc
{
  class qt_interpreter : public QObject
  {
    Q_OBJECT

  public:

    qt_interpreter (void);

    ~qt_interpreter (void) = default;

    qt_interpreter (const qt_interpreter&) = delete;

    qt_interpreter& operator = (const qt_interpreter&) = delete;

  signals:

    void result_ready (double);

    void error_signal (const QString&);

  public slots:

    void execute (void);

    void accept_input_line (const QString& line);

  private:

    interpreter m_interpreter;
  };
}

#endif