C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
27 lines
420 B
C++
27 lines
420 B
C++
#pragma once
|
|
|
|
#include <qnetworkaccessmanager.h>
|
|
#include <qobject.h>
|
|
#include <qqmlengine.h>
|
|
|
|
namespace ZShell {
|
|
|
|
class Requests : public QObject {
|
|
Q_OBJECT
|
|
QML_ELEMENT
|
|
QML_SINGLETON
|
|
|
|
public:
|
|
explicit Requests(QObject* parent = nullptr);
|
|
|
|
Q_INVOKABLE void get(
|
|
const QUrl& url,
|
|
QJSValue callback,
|
|
QJSValue onError = QJSValue()) const;
|
|
|
|
private:
|
|
QNetworkAccessManager* m_manager;
|
|
};
|
|
|
|
} // namespace ZShell
|