parent
d07da76383
commit
58987b2ec6
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtNetwork>
|
||||
|
||||
#include "FutureScheduler.h"
|
||||
|
||||
class Network : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Network(QObject *parent = nullptr);
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void get(const QString &url, const QJSValue &callback, const QString &contentType = {}) const;
|
||||
Q_INVOKABLE void getJSON(const QString &url, const QJSValue &callback) const;
|
||||
|
||||
private:
|
||||
mutable FutureScheduler m_scheduler;
|
||||
};
|
@ -1,29 +0,0 @@
|
||||
#ifndef PRICES_H
|
||||
#define PRICES_H
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QtNetwork>
|
||||
|
||||
#include "FutureScheduler.h"
|
||||
|
||||
class Prices : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Prices(QObject *parent = nullptr);
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void getJSON(const QString url) const;
|
||||
|
||||
private:
|
||||
void gotError(const QString &message) const;
|
||||
|
||||
signals:
|
||||
void priceJsonReceived(QVariantMap document) const;
|
||||
void priceJsonError(QString message) const;
|
||||
|
||||
private:
|
||||
mutable FutureScheduler m_scheduler;
|
||||
};
|
||||
|
||||
#endif // PRICES_H
|
Reference in new issue