Commit ec25e5f2 authored by Volker Krause's avatar Volker Krause
Browse files

Add QML support plugin

Work in progress, this does not allow to add data sources yet.
parent b2e5c7ab
......@@ -4,6 +4,7 @@
*.orig
*.out
CMakeLists.txt.user
*.qmlc
src/server/config/localconfig.php
src/server/data/*.sqlite
......@@ -70,7 +70,7 @@ endif()
if(Qt5Core_FOUND)
set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED)
find_package(Qt5 NO_MODULE REQUIRED COMPONENTS Network)
find_package(Qt5 NO_MODULE QUIET OPTIONAL_COMPONENTS Widgets Charts Test Help)
find_package(Qt5 NO_MODULE QUIET OPTIONAL_COMPONENTS Widgets Charts Test Help Qml)
set_package_properties(Qt5 PROPERTIES URL "http://qt-project.org/")
set_package_properties(Qt5Widgets PROPERTIES TYPE RECOMMENDED PURPOSE "Required for feedback configuration and notification widgets.")
......
......@@ -3,3 +3,6 @@ add_subdirectory(core)
if(TARGET Qt5::Widgets OR QT_QTGUI_LIBRARIES)
add_subdirectory(widgets)
endif()
if(TARGET Qt5::Qml)
add_subdirectory(qml)
endif()
set(provider_qml_srcs
qmlplugin.cpp
)
add_library(UserFeedbackQml SHARED ${provider_qml_srcs})
target_link_libraries(UserFeedbackQml
UserFeedbackCore
Qt5::Qml
)
install(TARGETS UserFeedbackQml DESTINATION ${QML_INSTALL_DIR}/org/kde/userfeedback)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/userfeedback)
module org.kde.userfeedback
plugin UserFeedbackQml
/*
Copyright (C) 2017 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "qmlplugin.h"
#include <Provider>
#include <QQmlEngine>
using namespace UserFeedback;
void QmlPlugin::registerTypes(const char* uri)
{
qmlRegisterType<Provider>(uri, 1, 0, "Provider");
}
/*
Copyright (C) 2017 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef USERFEEDBACK_QMLPLUGIN_H
#define USERFEEDBACK_QMLPLUGIN_H
#include <QQmlExtensionPlugin>
namespace UserFeedback {
class QmlPlugin : public QQmlExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
public:
void registerTypes(const char *uri) override;
};
}
#endif // USERFEEDBACK_QMLPLUGIN_H
/*
Copyright (C) 2017 Volker Krause <vkrause@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import QtQuick.Controls 2.1
import org.kde.userfeedback 1.0 as UserFeedback
ApplicationWindow {
id: root
UserFeedback.Provider {
id: provider
submissionInterval: 1
productIdentifier: "org.kde.orwell"
feedbackServer: "https://feedback.volkerkrause.eu/"
statisticsCollectionMode: UserFeedback.Provider.DetailedUsageStatistics
}
Button {
id: submitButton
text: "Submit!"
anchors.centerIn: parent
onClicked: provider.submit()
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment