From f0e65a9164097f7f3e5dbb8290b67b57951e11df Mon Sep 17 00:00:00 2001 From: Fanda Vacek Date: Sun, 27 Aug 2023 21:54:20 +0200 Subject: [PATCH] Cannot print report Competitors with rented cards #944 fixed --- libqf/plugins/qf/core/CMakeLists.txt | 12 ++-- libqf/plugins/qf/core/src/plugin.cpp | 60 ----------------- libqf/plugins/qf/core/src/qfcore_plugin.cpp | 64 +++++++++++++++++++ libqf/plugins/qf/core/src/qfcore_plugin.h | 17 +++++ .../qf/qmlreports/src/qfqmlreports_plugin.cpp | 5 +- .../qf/qmlreports/src/qfqmlreports_plugin.h | 10 +-- 6 files changed, 94 insertions(+), 74 deletions(-) delete mode 100644 libqf/plugins/qf/core/src/plugin.cpp create mode 100644 libqf/plugins/qf/core/src/qfcore_plugin.cpp create mode 100644 libqf/plugins/qf/core/src/qfcore_plugin.h diff --git a/libqf/plugins/qf/core/CMakeLists.txt b/libqf/plugins/qf/core/CMakeLists.txt index 1eebcd6be..fde7900fe 100644 --- a/libqf/plugins/qf/core/CMakeLists.txt +++ b/libqf/plugins/qf/core/CMakeLists.txt @@ -2,29 +2,31 @@ qt_add_qml_module(qfcoreplugin URI "qf.core" VERSION "1.0" PLUGIN_TARGET qfcoreplugin + RESOURCE_PREFIX qml/qf/core # QML_FILES ${qml_files} - RESOURCE_PREFIX qf/core/qml # PAST_MAJOR_VERSIONS 1 # NO_PLUGIN_OPTIONAL -# NO_GENERATE_PLUGIN_SOURCE + NO_GENERATE_PLUGIN_SOURCE # NO_GENERATE_QMLTYPES # INSTALL_SOURCE_QMLTYPES "plugins.qmltypes" ) target_sources(qfcoreplugin PRIVATE +# src/qfcore_plugin.h +# src/qmlfilesingleton.cpp + + src/qfcore_plugin.cpp src/crypt.cpp src/model/tablemodelcolumn.cpp src/model/sqltablemodel.cpp src/model/sqldatadocument.cpp - src/qmlfilesingleton.cpp src/settings.cpp src/sql/sqlconnection.cpp src/sql/sqlquery.cpp src/sql/sqlquerybuilder.cpp src/sql/sqlrecord.cpp src/sql/qmlsqlsingleton.cpp - #src/plugin.cpp src/qmllogsingleton.cpp core.qrc ) @@ -33,7 +35,7 @@ target_include_directories(qfcoreplugin PRIVATE src/sql) target_link_libraries(qfcoreplugin PUBLIC Qt::Core - Qt::Gui +# Qt::Gui Qt::Qml libqfcore ) diff --git a/libqf/plugins/qf/core/src/plugin.cpp b/libqf/plugins/qf/core/src/plugin.cpp deleted file mode 100644 index 928c5753c..000000000 --- a/libqf/plugins/qf/core/src/plugin.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "crypt.h" -#include "settings.h" - -#include "qmllogsingleton.h" -#include "qmlfilesingleton.h" -#include "sql/qmlsqlsingleton.h" -#include "sql/sqlconnection.h" -#include "sql/sqlquery.h" -#include "sql/sqlrecord.h" -#include "sql/sqlquerybuilder.h" -#include "model/sqldatadocument.h" - -#include "model/sqltablemodel.h" -#include "model/tablemodelcolumn.h" - -#include -#include - -#include -#include - -#include - -#include -#include - -class QmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") -public: - void registerTypes(const char *uri) - { - qfLogFuncFrame() << uri; - Q_ASSERT(uri == QLatin1String("qf.core")); - - qmlRegisterSingletonType(uri, 1, 0, "Log_helper", &qf::core::qml::QmlLogSingleton::singletontype_provider); - qmlRegisterSingletonType(uri, 1, 0, "File", &qf::core::qml::QmlFileSingleton::singletontype_provider); - qmlRegisterSingletonType(uri, 1, 0, "Sql", &qf::core::qml::QmlSqlSingleton::singletontype_provider); - - qmlRegisterType(uri, 1, 0, "Settings"); - qmlRegisterType(uri, 1, 0, "Crypt"); - - qmlRegisterType(uri, 1, 0, "SqlConnection"); - qmlRegisterType(uri, 1, 0, "SqlQuery"); - qmlRegisterType(uri, 1, 0, "SqlRecord"); - qmlRegisterType(uri, 1, 0, "SqlQueryBuilder"); - qmlRegisterType(uri, 1, 0, "SqlTableModel"); - qmlRegisterType(uri, 1, 0, "TableModel"); - qmlRegisterType(uri, 1, 0, "ModelColumn"); - - qmlRegisterType(uri, 1, 0, "DataDocument"); - qmlRegisterType(uri, 1, 0, "SqlDataDocument"); - - qmlRegisterType(uri, 1, 0, "NetworkAccessManager"); - qmlRegisterType(uri, 1, 0, "NetworkReply"); - } -}; - -#include "plugin.moc" diff --git a/libqf/plugins/qf/core/src/qfcore_plugin.cpp b/libqf/plugins/qf/core/src/qfcore_plugin.cpp new file mode 100644 index 000000000..fb2ac803e --- /dev/null +++ b/libqf/plugins/qf/core/src/qfcore_plugin.cpp @@ -0,0 +1,64 @@ +#include "qfcore_plugin.h" + +#include "crypt.h" +#include "settings.h" + +#include "qmllogsingleton.h" +//#include "qmlfilesingleton.h" +#include "sql/qmlsqlsingleton.h" +#include "sql/sqlconnection.h" +#include "sql/sqlquery.h" +#include "sql/sqlrecord.h" +#include "sql/sqlquerybuilder.h" +#include "model/sqldatadocument.h" + +#include "model/sqltablemodel.h" +#include "model/tablemodelcolumn.h" + +//#include +//#include + +//#include +//#include + +//#include + +//#include +//#include + +#include + +QT_BEGIN_NAMESPACE + +void QFCorePlugin::registerTypes(const char *uri) +{ + //qfLogFuncFrame() << uri; + Q_ASSERT(uri == QLatin1String("qf.core")); + + qmlRegisterSingletonType(uri, 1, 0, "Log_helper", &qf::core::qml::QmlLogSingleton::singletontype_provider); + //qmlRegisterSingletonType(uri, 1, 0, "File", &qf::core::qml::QmlFileSingleton::singletontype_provider); + qmlRegisterSingletonType(uri, 1, 0, "Sql", &qf::core::qml::QmlSqlSingleton::singletontype_provider); + + qmlRegisterType(uri, 1, 0, "SqlConnection"); + qmlRegisterType(uri, 1, 0, "SqlQuery"); + qmlRegisterType(uri, 1, 0, "SqlRecord"); + qmlRegisterType(uri, 1, 0, "SqlQueryBuilder"); + qmlRegisterType(uri, 1, 0, "SqlTableModel"); + qmlRegisterType(uri, 1, 0, "TableModel"); + qmlRegisterType(uri, 1, 0, "ModelColumn"); + + qmlRegisterType(uri, 1, 0, "DataDocument"); + qmlRegisterType(uri, 1, 0, "SqlDataDocument"); + + qmlRegisterType(uri, 1, 0, "Settings"); + qmlRegisterType(uri, 1, 0, "Crypt"); + + //qmlRegisterType(uri, 1, 0, "NetworkAccessManager"); + //qmlRegisterType(uri, 1, 0, "NetworkReply"); + + // Auto-increment the import to stay in sync with ALL future QtQuick minor versions + qmlRegisterModule(uri, 1, 0); +} + +QT_END_NAMESPACE + diff --git a/libqf/plugins/qf/core/src/qfcore_plugin.h b/libqf/plugins/qf/core/src/qfcore_plugin.h new file mode 100644 index 000000000..24b9ca44d --- /dev/null +++ b/libqf/plugins/qf/core/src/qfcore_plugin.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +QT_BEGIN_NAMESPACE + +class QFCorePlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + QFCorePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { } + void registerTypes(const char *uri) override; +}; + +QT_END_NAMESPACE diff --git a/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.cpp b/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.cpp index ad4d45379..262639285 100644 --- a/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.cpp +++ b/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.cpp @@ -1,6 +1,3 @@ -// Copyright (C) 2016 Kurt Pattyn . -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only - #include "qfqmlreports_plugin.h" #include @@ -19,7 +16,7 @@ QT_BEGIN_NAMESPACE -void QFQmlRepoertPlugin::registerTypes(const char *uri) +void QFQmlReportPlugin::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("qf.qmlreports")); diff --git a/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.h b/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.h index 1cbed5c63..8a7ac292b 100644 --- a/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.h +++ b/libqf/plugins/qf/qmlreports/src/qfqmlreports_plugin.h @@ -4,14 +4,14 @@ QT_BEGIN_NAMESPACE -class QFQmlRepoertPlugin : public QQmlExtensionPlugin +class QFQmlReportPlugin : public QQmlExtensionPlugin { - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) public: - QFQmlRepoertPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) override; + QFQmlReportPlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { } + void registerTypes(const char *uri) override; }; QT_END_NAMESPACE