summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/qalculator.hpp
blob: a07a8a2fc6ccd704597b2816588d9c2d6c51e2fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include <qobject.h>
#include <qqmlintegration.h>

namespace caelestia {

class Qalculator : public QObject {
    Q_OBJECT
    QML_ELEMENT
    QML_SINGLETON

public:
    explicit Qalculator(QObject* parent = nullptr);

    Q_INVOKABLE QString eval(const QString& expr, bool printExpr = true) const;
};

} // namespace caelestia