summaryrefslogtreecommitdiff
path: root/plugin/src/Caelestia/qalculator.hpp
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-04 15:40:31 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-04 15:40:31 +1000
commit050ddf7c3e4ea6aa7a18087d17aee2a43781d0af (patch)
tree58a93f727211aa79604891d6536b5e01b56ef795 /plugin/src/Caelestia/qalculator.hpp
parentplugin/cim: use QtConcurrent (diff)
downloadcaelestia-shell-050ddf7c3e4ea6aa7a18087d17aee2a43781d0af.tar.gz
caelestia-shell-050ddf7c3e4ea6aa7a18087d17aee2a43781d0af.tar.bz2
caelestia-shell-050ddf7c3e4ea6aa7a18087d17aee2a43781d0af.zip
plugin: add qalculator
For launcher >calc instead of qalc proc
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;
+};