@ludea/

JuvenilePrivateLava

C++

No description

fork
loading
Files
  • main.cpp
  • Signin.qml
  • main.qml
  • request.cpp
  • request.h

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.11328822466440602","path":"main.cpp","file":{"path":"main.cpp","content":{"asEncoding":{"base64":"I2luY2x1ZGUgPFFHdWlBcHBsaWNhdGlvbj4KI2luY2x1ZGUgPFFRbWxBcHBsaWNhdGlvbkVuZ2luZT4KCiNpbmNsdWRlIDxpb3N0cmVhbT4KCiNpbmNsdWRlICJ0Y3BfY2xpZW50LmgiCiNpbmNsdWRlICJtZXNzYWdlLmgiCiNpbmNsdWRlICJvYnNlcnZlci5oIgojaW5jbHVkZSAicmVxdWVzdC5oIgojaW5jbHVkZSAicm9vdF9jZXJ0aWZpY2F0ZXMuaCIKCiNpbmNsdWRlIDxRRGVidWc+CiNpbmNsdWRlIDxRT2JqZWN0PgojaW5jbHVkZSA8UVF1aWNrSXRlbT4KI2luY2x1ZGUgPFFRbWxDb250ZXh0PgoKCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKICAgIFFHdWlBcHBsaWNhdGlvbiBhcHAoYXJnYywgYXJndik7CgogICAgUVFtbEFwcGxpY2F0aW9uRW5naW5lIGVuZ2luZTsKCiAgICBib29zdDo6YXNpbzo6aW9fY29udGV4dCBpb19jb250ZXh0OwogICAgdGNwOjpyZXNvbHZlciByZXNvbHZlcihpb19jb250ZXh0KTsKICAgIGJvb3N0Ojphc2lvOjpzc2w6OmNvbnRleHQgY3R4e3NzbDo6Y29udGV4dDo6c3NsdjIzX2NsaWVudH07CiAgICBsb2FkX3Jvb3RfY2VydGlmaWNhdGVzKGN0eCk7CiAgICB0Y3BfY2xpZW50IGMoaW9fY29udGV4dCk7CiAgICByZXF1ZXN0IHJlcXVlc3QoaW9fY29udGV4dCwgY3R4KTsKCiAgICBlbmdpbmUucm9vdENvbnRleHQoKS0+c2V0Q29udGV4dFByb3BlcnR5KCJ0Y3BfY2xpZW50IiwgJmMpOwogICAgZW5naW5lLnJvb3RDb250ZXh0KCktPnNldENvbnRleHRQcm9wZXJ0eSgiaHR0cDEiLCAmcmVxdWVzdCk7CiAgICBRT2JqZWN0Ojpjb25uZWN0KCZyZXF1ZXN0LCZyZXF1ZXN0Ojpsb2dpbixbXSgpewogICAgICAgIHFEZWJ1ZygpIDw8ICJMb2dpbiBTdWNjZXNzZnVsbCIgPDxlbmRsOwogICAgfSk7CgogICAgZW5naW5lLmxvYWQoUVVybChRU3RyaW5nTGl0ZXJhbCgicXJjOi9tYWluLnFtbCIpKSk7CgogICAgcmV0dXJuIGFwcC5leGVjKCk7Cn0K"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <QGuiApplication>
#include <QQmlApplicationEngine>

#include <iostream>

#include "tcp_client.h"
#include "message.h"
#include "observer.h"
#include "request.h"
#include "root_certificates.h"

#include <QDebug>
#include <QObject>
#include <QQuickItem>
#include <QQmlContext>


int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;

    boost::asio::io_context io_context;
    tcp::resolver resolver(io_context);
    boost::asio::ssl::context ctx{ssl::context::sslv23_client};
    load_root_certificates(ctx);
    tcp_client c(io_context);
    request request(io_context, ctx);

    engine.rootContext()->setContextProperty("tcp_client", &c);
    engine.rootContext()->setContextProperty("http1", &request);
    QObject::connect(&request,&request::login,[](){
        qDebug() << "Login Successfull" <<endl;
    });

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    return app.exec();
}