File indexing completed on 2024-04-28 04:45:39
0001 #pragma once 0002 #include <QFileInfo> 0003 #include <QObject> 0004 #include <QProcess> 0005 #include <QDebug> 0006 0007 #include <MauiKit3/FileBrowsing/fmstatic.h> 0008 0009 class Nota : public QObject 0010 { 0011 Q_OBJECT 0012 0013 public: 0014 static Nota *instance() 0015 { 0016 static Nota nota; 0017 return ¬a; 0018 } 0019 0020 Nota(const Nota &) = delete; 0021 Nota &operator=(const Nota &) = delete; 0022 Nota(Nota &&) = delete; 0023 Nota &operator=(Nota &&) = delete; 0024 0025 public Q_SLOTS: 0026 bool run(const QString &process, const QStringList ¶ms = {}) 0027 { 0028 auto m_process = new QProcess; 0029 // connect(myProcess,SIGNAL(readyReadStandardError()),this,SLOT(vEdProcess())); 0030 // connect(myProcess,SIGNAL(readyReadStandardOutput()),this,SLOT(processStandardOutput())); 0031 connect(m_process, SIGNAL(finished(int)), m_process, SLOT(deleteLater())); 0032 connect(this, &QObject::destroyed, m_process, &QProcess::kill); 0033 m_process->start(process, params); 0034 return true; 0035 } 0036 0037 private: 0038 explicit Nota(QObject *parent = nullptr) 0039 : QObject(parent) 0040 { 0041 } 0042 };