From 425e3f84e35d3014b4d6253b0c05d3490090c6cf Mon Sep 17 00:00:00 2001 From: Oleg-designer <sweetletal0@gmail.com> Date: Fri, 16 Apr 2021 09:49:55 +0300 Subject: [PATCH 1/6] ref #5 qmlnotifyservice.h fix --- qmlnotifyservice.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qmlnotifyservice.h b/qmlnotifyservice.h index a7cbcce..eb9357c 100644 --- a/qmlnotifyservice.h +++ b/qmlnotifyservice.h @@ -9,18 +9,19 @@ class QQmlApplicationEngine; /** * Simple notify service for qml. * Use : + * @code cpp * #include <qmlnotifyservice.h> - * * QmlNotificationService::init(); * auto service = QmlNotificationService::NotificationService::getService() * service->setNotify("title", "text", "UrlOfImage", NotificationData::Normal) - * + * @endcode * * in qml : - * + * @code cpp * NotificationServiceView { anchors.fill: parent; } + * @endcode */ namespace QmlNotificationService { bool NOTIFYSERVICESHARED_EXPORT init(QQmlApplicationEngine *engine); From 6999c2944d2087fe7844e1d60ba4a695b207b5d5 Mon Sep 17 00:00:00 2001 From: Oleg-designer <78071329+Oleg-designer@users.noreply.github.com> Date: Fri, 16 Apr 2021 09:58:21 +0300 Subject: [PATCH 2/6] Update qmlnotifyservice.h Co-authored-by: Andrei Yankovich <EndrIIMail@gmail.com> --- qmlnotifyservice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmlnotifyservice.h b/qmlnotifyservice.h index eb9357c..c151672 100644 --- a/qmlnotifyservice.h +++ b/qmlnotifyservice.h @@ -17,7 +17,7 @@ class QQmlApplicationEngine; * @endcode * * in qml : - * @code cpp + * @code qml * NotificationServiceView { anchors.fill: parent; } From 79478790edf3086bea2acfb3d9d78842c7c95734 Mon Sep 17 00:00:00 2001 From: Oleg-designer <sweetletal0@gmail.com> Date: Fri, 16 Apr 2021 10:14:13 +0300 Subject: [PATCH 3/6] ref #5 add examples in qmlnotifyservice.h --- qmlnotifyservice.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/qmlnotifyservice.h b/qmlnotifyservice.h index c151672..aef519d 100644 --- a/qmlnotifyservice.h +++ b/qmlnotifyservice.h @@ -21,6 +21,46 @@ class QQmlApplicationEngine; * NotificationServiceView { anchors.fill: parent; } + * @endcode + * Questions + * CPP + * @code cpp + #include <qmlnotifyservice.h> + + int main() { + QmlNotificationService::init(); + auto service = QmlNotificationService::NotificationService::getService(); + int questionCode = service->setQuestion("title", "some text"); + + QObject::connect(service, QmlNotificationService::NotificationService::questionCompleted, + [questionCode](bool accepted, int questionCode) { + if (accepted && code === questionCode) { + // your action here. + } + }) + + + } + * @endcode + * QML + * @code qml + NotificationServiceView { + anchors.fill: parent; + } + +readonly property int questionCode: 0; + +questionCode = notificationService.setQuestion(qsTr("Remove %0 user").arg(userModel.userId), + qsTr("All saved data and records will be delete, Do you want continuee?")) +Connections { + target: notificationService + function onQuestionCompleted(accepted, code) { + if (accepted && code === privateRoot.questionCode) { + if (userModel) + backEnd.removeUser(userModel.userId) + } + } +} * @endcode */ namespace QmlNotificationService { From 5d3ad274e94b2f0b5cf567e1c1842ffe631f064a Mon Sep 17 00:00:00 2001 From: Oleg-designer <78071329+Oleg-designer@users.noreply.github.com> Date: Fri, 16 Apr 2021 10:23:12 +0300 Subject: [PATCH 4/6] Update qmlnotifyservice.h Co-authored-by: Andrei Yankovich <EndrIIMail@gmail.com> --- qmlnotifyservice.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmlnotifyservice.h b/qmlnotifyservice.h index aef519d..93fa78b 100644 --- a/qmlnotifyservice.h +++ b/qmlnotifyservice.h @@ -24,7 +24,7 @@ class QQmlApplicationEngine; * @endcode * Questions * CPP - * @code cpp + * @code{cpp} #include <qmlnotifyservice.h> int main() { @@ -43,7 +43,7 @@ class QQmlApplicationEngine; } * @endcode * QML - * @code qml + * @code{qml} NotificationServiceView { anchors.fill: parent; } From 493defb5fcd3c1e8ab2e612245ebafeab6605eb2 Mon Sep 17 00:00:00 2001 From: Oleg-designer <78071329+Oleg-designer@users.noreply.github.com> Date: Fri, 16 Apr 2021 10:23:33 +0300 Subject: [PATCH 5/6] Update qmlnotifyservice.h Co-authored-by: Andrei Yankovich <EndrIIMail@gmail.com> --- qmlnotifyservice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmlnotifyservice.h b/qmlnotifyservice.h index 93fa78b..752d66d 100644 --- a/qmlnotifyservice.h +++ b/qmlnotifyservice.h @@ -9,7 +9,7 @@ class QQmlApplicationEngine; /** * Simple notify service for qml. * Use : - * @code cpp + * @code{cpp} * #include <qmlnotifyservice.h> * QmlNotificationService::init(); * auto service = QmlNotificationService::NotificationService::getService() From d10223a339250f613ed7d3f6c68e252250ebdcbf Mon Sep 17 00:00:00 2001 From: Oleg-designer <78071329+Oleg-designer@users.noreply.github.com> Date: Fri, 16 Apr 2021 10:23:45 +0300 Subject: [PATCH 6/6] Update qmlnotifyservice.h Co-authored-by: Andrei Yankovich <EndrIIMail@gmail.com> --- qmlnotifyservice.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmlnotifyservice.h b/qmlnotifyservice.h index 752d66d..c4b6279 100644 --- a/qmlnotifyservice.h +++ b/qmlnotifyservice.h @@ -17,7 +17,7 @@ class QQmlApplicationEngine; * @endcode * * in qml : - * @code qml + * @code{qml} * NotificationServiceView { anchors.fill: parent; }