/
s5z6
/
telegraf
Обзор
Документация
Войти
/
s5z6
/
telegraf
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
qml/components/AppNotification.qml
56 строк
1 KB
Nikolai Sinyov
FIXED: : Cannot read property of null для AppNotification.qml
12 фев 2025, 14:32
12 фев 2025, 14:32
5310c41
Код
Авторство
О чём код?
import QtQuick 2.6 import Sailfish.Silica 1.0 Item { id: notificationItem z: 42 y: -100 Behavior on y { PropertyAnimation { easing.type: Easing.OutCubic } } anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined width: parent ? (parent.width - 2 * Theme.horizontalPageMargin) : 0 function show(message, additionalInformation) { notificationTextItem.text = message; if (additionalInformation) { notificationTextItem.additionalInformation = additionalInformation; } notificationTimer.start(); notificationTextItem.visible = true; notificationTextItem.opacity = 1; notificationItem.y = notificationItem.parent.height / 2; } Connections { target: notificationTimer onTriggered: { notificationItem.y = notificationItem.parent.height + 100; notificationTextItem.opacity = 0; notificationResetter.start(); } } Connections { target: notificationResetter onTriggered: { notificationTextItem.visible = false; notificationItem.y = -100 } } Timer { id: notificationTimer repeat: false interval: 3500 } Timer { id: notificationResetter repeat: false interval: 2000 } AppNotificationItem { id: notificationTextItem } }