notify is work

This commit is contained in:
Andrei Yankovich 2019-08-20 17:04:03 +03:00
parent 6fd2976004
commit 4f8db0f267
4 changed files with 13 additions and 14 deletions

View File

@ -1,6 +1,8 @@
#include "notificationservice.h"
NotificationService::NotificationService(QObject * ptr): QObject (ptr) {
qRegisterMetaType<NotificationData>("NotificationData");
qRegisterMetaType<QList<NotificationData>> ("QList<NotificationData>");
}

View File

@ -31,8 +31,6 @@ bool ClientApp::init(QQmlApplicationEngine *engine) {
qmlRegisterType <Diff> ();
qmlRegisterType <MainMenuModel> ();
qmlRegisterType <UserView> ();
qRegisterMetaType<NotificationData>("NotificationData");
qRegisterMetaType<QList<NotificationData>> ("QList<NotificationData>");
auto root = engine->rootContext();
if (!root)

View File

@ -13,24 +13,23 @@ BasePopUp {
autoClose: true;
closeInterval: 5000
margins: 0
spacing: 0
Page {
id: page
title: titleText
anchors.fill: parent
header: Label {
text: titleText
horizontalAlignment: Text.AlignHCenter
}
contentItem:
RowLayout {
id: rowLayout
spacing: 5
clip: true
anchors.top: parent.bottom
anchors.topMargin: 1
anchors.left: parent.left
anchors.leftMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
Rectangle {
color: "#00000000"
@ -43,14 +42,14 @@ BasePopUp {
fillMode: Image.PreserveAspectCrop
clip: true
anchors.fill: parent;
source: ""
source: img
}
}
Label {
id: message
text: qsTr("Message")
text: popup.text
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.fillHeight: true;
Layout.fillWidth: true;

View File

@ -12,7 +12,7 @@ Item {
NotificationForm {
id: notyfyView
titleText : (msg)? msg.title: "";
titleText : msg.title;
text: (msg)? msg.text: "";
img: (msg)? msg.img: "";