diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-04 15:40:31 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-04 15:40:31 +1000 |
| commit | 050ddf7c3e4ea6aa7a18087d17aee2a43781d0af (patch) | |
| tree | 58a93f727211aa79604891d6536b5e01b56ef795 /plugin/src/Caelestia/qalculator.hpp | |
| parent | plugin/cim: use QtConcurrent (diff) | |
| download | caelestia-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.hpp | 15 |
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; +}; |