Convenience class for processing the result of Process::findQt()
Let's say you have a Widget which needs to process a PdCom::Variable instance.
class MyWidget : public QObject
{
Q_OBJECT
public:
MyWidget(QObject *parent) : QObject(parent) {}
{
connect(watcher, &QtPdCom::VariableWatcher::finished,
this, &MyWidget::onVariableFound);
connect(watcher, &QtPdCom::VarableWatcher::cancelled,
watcher, &QObject::deleteLater);
watcher->setFuture(proc.
find(path));
}
private slots:
void onVariableFound()
{
const auto watcher =
qobject_cast<QtPdCom::FindVariableWatcher*>(QObject::sender()); if
(!watcher) return;
const PdCom::Variable result = watcher->result();
watcher->deleteLater();
}
};