comparison qt-interpreter.cpp @ 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 1e5a1e15fa56
comparison
equal deleted inserted replaced
6:1b575145197e 7:04867eba6428
1 #include <iostream>
1 #include <sstream> 2 #include <sstream>
2 3
3 #include <QString> 4 #include <QString>
4 5
5 #include "gui-main.h" 6 #include "gui-main.h"
11 12
12 namespace calc 13 namespace calc
13 { 14 {
14 qt_interpreter::qt_interpreter (void) 15 qt_interpreter::qt_interpreter (void)
15 : m_interpreter () 16 : m_interpreter ()
16 { } 17 {
18 m_interpreter.set_error_handler ([this] (const char *msg)
19 { emit this->error_signal (msg); });
20
21 m_interpreter.set_result_handler ([this] (double value)
22 { emit this->result_ready (value); });
23 }
17 24
18 void qt_interpreter::execute (void) 25 void qt_interpreter::execute (void)
19 { 26 {
20 } 27 }
21 28