#ifndef SCRIPTSESSION_H
#define SCRIPTSESSION_H
#include "AllHead.h"
#include <QObject>
#include <QJSValue>

class QElapsedTimer;
class QJSEngine;
class QConsoleWidget;

class ScriptSession : public QObject
{
    Q_OBJECT
public:
    explicit ScriptSession(QConsoleWidget *w);

    QConsoleWidget* widget() { return w; }


    void tic();
    qreal toc();

public slots:
    void REPL();
    void quit();

private slots:
    void abortEvaluation();

private:
    QConsoleWidget* w;
    QJSEngine* e;
    QElapsedTimer* tmr_;





//-- 构建元素绑定  -------------------------
public:
 
    void settingApplication(QObject* object);
    void addJsObeject(const QString& objname, QObject* obj);


//---------------------------




};

#endif // SCRIPTSESSION_H
