Commit 50a8ad26 authored by Aleix Pol's avatar Aleix Pol
Browse files

Expose information to Qt metaobject system

Summary: So that it can be integrated in QtQuick applications

Test Plan: Implemented it Discover, everything seems to work

Reviewers: vkrause

Reviewed By: vkrause

Differential Revision: https://phabricator.kde.org/D5960
parent e14e3df2
......@@ -108,7 +108,11 @@ public:
DetailedSystemInformation = 0x30, ///< Transmit detailed system information.
DetailedUsageStatistics = 0x40, ///< Transmit detailed usage statistics.
};
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
Q_ENUM(StatisticsCollectionMode)
#else
Q_ENUMS(StatisticsCollectionMode)
#endif
/*! Create a new feedback provider.
* @param parent The parent object.
......
......@@ -99,3 +99,7 @@ SurveyInfo SurveyInfo::fromJson(const QJsonObject& obj)
#endif
return s;
}
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include "surveyinfo.moc"
#endif
......@@ -21,6 +21,12 @@
#include "userfeedbackcore_export.h"
#include <QSharedDataPointer>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <qobjectdefs.h>
#include <QUrl>
#include <QUuid>
#endif
QT_BEGIN_NAMESPACE
class QJsonObject;
......@@ -37,6 +43,13 @@ class SurveyInfoData;
*/
class USERFEEDBACKCORE_EXPORT SurveyInfo
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
Q_GADGET
Q_PROPERTY(bool isValid READ isValid)
Q_PROPERTY(QUrl url READ url)
Q_PROPERTY(QString target READ target)
Q_PROPERTY(QUuid uuid READ uuid)
#endif
public:
/*! Create an empty, invalid survey request. */
SurveyInfo();
......
......@@ -6,7 +6,7 @@ if(TARGET UserFeedbackWidgets AND NOT (CMAKE_SOURCE_DIR EQUAL CMAKE_CURRENT_SOUR
target_link_libraries(notificationpopuptest UserFeedbackWidgets)
add_executable(orwell orwell.cpp)
target_link_libraries(orwell UserFeedbackWidgets ${QT_QTGUI_LIBRARIES})
target_link_libraries(orwell UserFeedbackWidgets)
else()
# stand-alone build for testing includes and cmake config
message(STATUS "building test application stand-alone")
......
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