summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/qalculator.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/src/Caelestia/qalculator.hpp')
-rw-r--r--plugin/src/Caelestia/qalculator.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugin/src/Caelestia/qalculator.hpp b/plugin/src/Caelestia/qalculator.hpp
new file mode 100644
index 0000000..266699f
--- /dev/null
+++ b/plugin/src/Caelestia/qalculator.hpp
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <QObject>
+#include <qqmlintegration.h>
+
+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;
+};