53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QtQml/qqmlregistration.h>
|
|
|
|
#include "alignaudit.hpp"
|
|
|
|
namespace ZShell {
|
|
|
|
class AlignAuditor : public QObject {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
|
|
Q_PROPERTY(QString outputPath MEMBER m_outputPath NOTIFY outputPathChanged)
|
|
Q_PROPERTY(int delayMs MEMBER m_delayMs NOTIFY delayMsChanged)
|
|
Q_PROPERTY(bool paintedOnly MEMBER m_paintedOnly NOTIFY paintedOnlyChanged)
|
|
Q_PROPERTY(
|
|
bool includeInherited MEMBER m_includeInherited NOTIFY
|
|
includeInheritedChanged)
|
|
Q_PROPERTY(double tolerance MEMBER m_tolerance NOTIFY toleranceChanged)
|
|
Q_PROPERTY(int lastCount READ lastCount NOTIFY finished)
|
|
|
|
public:
|
|
explicit AlignAuditor(QObject* parent = nullptr) : QObject(parent) {}
|
|
|
|
Q_INVOKABLE int run();
|
|
|
|
Q_INVOKABLE void runLater();
|
|
|
|
int lastCount() const { return m_lastCount; }
|
|
|
|
signals:
|
|
void outputPathChanged();
|
|
void delayMsChanged();
|
|
void paintedOnlyChanged();
|
|
void includeInheritedChanged();
|
|
void toleranceChanged();
|
|
void finished(int count);
|
|
|
|
private:
|
|
Options options() const;
|
|
|
|
QString m_outputPath = QStringLiteral("/tmp/align-audit.txt");
|
|
int m_delayMs = 5000;
|
|
bool m_paintedOnly = true;
|
|
bool m_includeInherited = false;
|
|
double m_tolerance = 1e-3;
|
|
int m_lastCount = 0;
|
|
};
|
|
|
|
} // namespace ZShell
|