diff options
-rw-r--r-- | Login.qml | 3 | ||||
-rw-r--r-- | kelakon.pro | 32 | ||||
-rw-r--r-- | main.cxx | 10 | ||||
-rw-r--r-- | main.qml | 22 | ||||
-rw-r--r-- | networkworker.cxx | 13 | ||||
-rw-r--r-- | networkworker.hxx | 14 |
6 files changed, 84 insertions, 10 deletions
@@ -1,6 +1,9 @@ import QtQuick 2.12 LoginForm { + width: appWindow.width + height: appWindow.height + emailButton { onClicked: { stackView.push("qrc:/pages/Email.qml") diff --git a/kelakon.pro b/kelakon.pro index cbd9221..12dc52d 100644 --- a/kelakon.pro +++ b/kelakon.pro @@ -1,10 +1,40 @@ QT += quickcontrols2 +HEADERS += \ + networkworker.hxx \ + user.hxx + SOURCES += \ - main.cxx + networkworker.cxx \ + user.cxx \ + main.cxx RESOURCES += kelakon.qrc +INCLUDEPATH += $$PWD/rtclient + +LIBS += \ + $$PWD/rtclient/librtclient.a \ + -lcurl + +contains(ANDROID_TARGET_ARCH,arm64-v8a) { + QMAKE_CFLAGS += -I/usr/local/aarch64-linux-android/sysroot/usr/include + LIBS += -L/usr/local/aarch64-linux-android/sysroot/usr/lib + ANDROID_EXTRA_LIBS += \ + /usr/local/aarch64-linux-android/sysroot/usr/lib/libcrypto.so \ + /usr/local/aarch64-linux-android/sysroot/usr/lib/libssl.so \ + /usr/local/aarch64-linux-android/sysroot/usr/lib/libcurl.so +} + +contains(ANDROID_TARGET_ARCH,armeabi-v7a) { + QMAKE_CFLAGS += -I/usr/local/arm-linux-androideabi/sysroot/usr/include + LIBS += -L/usr/local/arm-linux-androideabi/sysroot/usr/lib + ANDROID_EXTRA_LIBS += \ + /usr/local/arm-linux-androideabi/sysroot/usr/lib/libcrypto.so \ + /usr/local/arm-linux-androideabi/sysroot/usr/lib/libssl.so \ + /usr/local/arm-linux-androideabi/sysroot/usr/lib/libcurl.so +} + android { ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android } @@ -1,11 +1,21 @@ #include <QGuiApplication> #include <QQmlApplicationEngine> +#include <QThread> +#include "networkworker.hxx" int main(int argc, char* argv[]) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; + + NetworkWorker worker{}; + QThread thread; + worker.moveToThread(&thread); + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + + thread.start(); + return app.exec(); } @@ -2,13 +2,17 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 ApplicationWindow { - id: appWindow - width: 360 - height: 640 - visible: true - - StackView { - id: stackView - initialItem: Login {} - } + id: appWindow + width: 362 + height: 628 + visible: true + + StackView { + id: stackView + width: 362 + height: 628 + + initialItem: Login {} + } + } diff --git a/networkworker.cxx b/networkworker.cxx new file mode 100644 index 0000000..3487d4c --- /dev/null +++ b/networkworker.cxx @@ -0,0 +1,13 @@ +#include "rtclient.h" +#include "networkworker.hxx" + +NetworkWorker::NetworkWorker(QObject* parent) : + QObject{parent} +{ + rtclient_init(); +} + +NetworkWorker::~NetworkWorker() +{ + rtclient_cleanup(); +} diff --git a/networkworker.hxx b/networkworker.hxx new file mode 100644 index 0000000..05124d5 --- /dev/null +++ b/networkworker.hxx @@ -0,0 +1,14 @@ +#ifndef NETWORKWORKER_HXX +#define NETWORKWORKER_HXX + +#include <QObject> + +class NetworkWorker : public QObject +{ + Q_OBJECT + public: + explicit NetworkWorker(QObject* parent = nullptr); + virtual ~NetworkWorker(); +}; + +#endif // NETWORKWORKER_HXX |