File indexing completed on 2024-12-01 13:10:58

0001 /*
0002     SPDX-FileCopyrightText: 2018 Ralf Habacker ralf.habacker @freenet.de
0003 
0004     This file is part of libalkimia.
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #include "alkonlinequote.h"
0010 
0011 #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
0012 #include <QGuiApplication>
0013 #include <QQmlApplicationEngine>
0014 #else
0015 #include <QApplication>
0016 class QGuiApplication : public QApplication
0017 {
0018 public:
0019     QGuiApplication(int &argc, char **argv) : QApplication(argc, argv) {}
0020 };
0021 
0022 #include <QDeclarativeEngine>
0023 #include <QDeclarativeView>
0024 #include <QFile>
0025 
0026 class QQmlApplicationEngine : public QDeclarativeEngine
0027 {
0028 public:
0029     void load(const QString &url)
0030     {
0031         QString s = url;
0032         s.replace(".qml", "-qt4.qml");
0033         QUrl a = QUrl::fromLocalFile(s);
0034         view.setSource(a);
0035         view.show();
0036     }
0037     QDeclarativeView view;
0038 };
0039 #endif
0040 
0041 int main(int argc, char *argv[])
0042 {
0043     QGuiApplication app(argc, argv);
0044 
0045     QQmlApplicationEngine engine;
0046     engine.load(CMAKE_CURRENT_SOURCE_DIR "/qmlalkonlinequotetest.qml");
0047 
0048     return app.exec();
0049 }