From 59cb3d09164478eec2b095e444b4df0f896ef137 Mon Sep 17 00:00:00 2001 From: EndrII Date: Tue, 30 Sep 2025 19:50:29 +0200 Subject: [PATCH 1/8] added image effects instance --- ViewSolutions/ViewSolutions/ImageView.qml | 1 + ViewSolutions/src/basehashmodel.h | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ViewSolutions/ViewSolutions/ImageView.qml b/ViewSolutions/ViewSolutions/ImageView.qml index 0c01aec..c6975af 100644 --- a/ViewSolutions/ViewSolutions/ImageView.qml +++ b/ViewSolutions/ViewSolutions/ImageView.qml @@ -16,6 +16,7 @@ AbstractButton { id: root property string source: "" property alias imagesource: sourceImg + property alias imagEffect: imgEffect property int radius: 16 property real power: 1.0 diff --git a/ViewSolutions/src/basehashmodel.h b/ViewSolutions/src/basehashmodel.h index 9f7cdd8..432c86e 100644 --- a/ViewSolutions/src/basehashmodel.h +++ b/ViewSolutions/src/basehashmodel.h @@ -43,11 +43,12 @@ class BaseHashModel: public QAbstractListModel { public: + BaseHashModel(QObject* parent = nullptr): QAbstractListModel(parent) { } - int rowCount(const QModelIndex &parent) const override { + int rowCount(const QModelIndex &) const override { return m_data.size(); } @@ -114,6 +115,10 @@ class BaseHashModel: public QAbstractListModel return {}; } + DATA get(const KEY& key) { + return m_data.value(key); + } + const QHash& dateList() const { return m_data; } From 17d1bc295632e431601d9388b75760e4597944eb Mon Sep 17 00:00:00 2001 From: EndrII Date: Wed, 8 Oct 2025 22:09:58 +0200 Subject: [PATCH 2/8] added extendable widget --- ViewSolutions/ViewSolutions/Extendable.qml | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 ViewSolutions/ViewSolutions/Extendable.qml diff --git a/ViewSolutions/ViewSolutions/Extendable.qml b/ViewSolutions/ViewSolutions/Extendable.qml new file mode 100644 index 0000000..c70e96f --- /dev/null +++ b/ViewSolutions/ViewSolutions/Extendable.qml @@ -0,0 +1,78 @@ +//# +//# Copyright (C) 2025-2025 QuasarApp. +//# Distributed under the GPLv3 software license, see the accompanying +//# Everyone is permitted to copy and distribute verbatim copies +//# of this license document, but changing it is not allowed. +//# + +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +Control { + + id: root + + property alias extendableWidget: extendetArea.contentItem + property alias mainWidget: mainButton.contentItem + // see GridLayout + property alias layoutDirection: columnLayout.layoutDirection + property alias flow: columnLayout.flow + + property alias extended: extendetArea.visible + property int animationDuration: 600 + + contentItem: GridLayout { + id: columnLayout + columnSpacing: 0 + rowSpacing: 0 + + Control { + id: extendetArea + clip: true + padding: 0 + Layout.alignment: Qt.AlignCenter + + Behavior on implicitHeight { + + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } + + Behavior on implicitWidth { + enabled: root.flow === GridLayout.LeftToRight + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } + + } + + Control { + Layout.alignment: Qt.AlignCenter + padding: 0 + id: mainButton + + Behavior on implicitHeight { + + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + + } + } + + Behavior on implicitWidth { + enabled: root.flow === GridLayout.LeftToRight + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + + } + } + } + } +} From 00e8365340df27aa79ef795a8665a11809fb29c8 Mon Sep 17 00:00:00 2001 From: EndrII Date: Wed, 15 Oct 2025 19:25:38 +0200 Subject: [PATCH 3/8] added custom message type --- ViewSolutions/src/notificationdata.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ViewSolutions/src/notificationdata.h b/ViewSolutions/src/notificationdata.h index 7b2f07b..c5ad70c 100644 --- a/ViewSolutions/src/notificationdata.h +++ b/ViewSolutions/src/notificationdata.h @@ -31,6 +31,9 @@ class VIEWSOLUTION_EXPORT NotificationData Warning = 1, /// This is critical error notifications. Error = 2, + + /// This is user defined type of message. + Custom = 3, }; explicit NotificationData(const QString& title = "", From 5e56566f3aa4a74a0387025c7cdfe575ea6095d2 Mon Sep 17 00:00:00 2001 From: EndrII Date: Thu, 16 Oct 2025 01:11:29 +0200 Subject: [PATCH 4/8] update notifications --- ViewSolutions/ViewSolutions/Metrix.qml | 32 ------------------- .../ViewSolutions/NotificationServiceView.qml | 32 ++++++++----------- ViewSolutions/src/notificationservice.h | 3 +- 3 files changed, 16 insertions(+), 51 deletions(-) delete mode 100644 ViewSolutions/ViewSolutions/Metrix.qml diff --git a/ViewSolutions/ViewSolutions/Metrix.qml b/ViewSolutions/ViewSolutions/Metrix.qml deleted file mode 100644 index b3d2adc..0000000 --- a/ViewSolutions/ViewSolutions/Metrix.qml +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2018-2024 QuasarApp. - * Distributed under the GPLv3 software license, see the accompanying - * Everyone is permitted to copy and distribute verbatim copies - * of this license document, but changing it is not allowed. -*/ - -import QtQuick -import QtQuick.Window -import QtQuick.Controls.Material -import QtQuick.Controls - -Item { - readonly property int pointCount: 100; - readonly property real mm: Screen.pixelDensity - readonly property real sm: 10 * mm - readonly property real dsm: Math.sqrt(Math.pow(Screen.desktopAvailableWidth, 2) + Math.pow(Screen.desktopAvailableHeight, 2)) / sm - readonly property real pt: getfactor(dsm) * sm - readonly property real controlPtMaterial: Material.buttonHeight - readonly property real gamePt: (width < height) ? width / pointCount : height / pointCount; - - function getfactor(dsm) { - if ( dsm < 70) { - return 1 - } else if (dsm < 140) { - return 2; - } else - return 4; - } - - anchors.fill: parent; -} diff --git a/ViewSolutions/ViewSolutions/NotificationServiceView.qml b/ViewSolutions/ViewSolutions/NotificationServiceView.qml index 1fc37a4..b0f9885 100644 --- a/ViewSolutions/ViewSolutions/NotificationServiceView.qml +++ b/ViewSolutions/ViewSolutions/NotificationServiceView.qml @@ -18,45 +18,41 @@ Item { readonly property var history: model.history - Metrix { - id: metrix - } - NotificationForm { id: notyfyView - titleText : msg.title(); - text: (msg)? msg.text(): ""; - img: (msg && msg.img().length)? msg.img(): getDefaultImage((msg)? msg.type(): 0); - type: (msg)? msg.type(): 0; + titleText : root.msg.title(); + text: (root.msg)? root.msg.text(): ""; + img: (root.msg && root.msg.img().length)? root.msg.img(): getDefaultImage((root.msg)? root.msg.type(): 0); + type: (root.msg)? root.msg.type(): 0; x: parent.width - width - margin; y: margin; - width: Math.min(6 * metrix.pt, root.width); + width: Math.min(440, root.width); } YesNoQuestion { id: questionMsgBox - titleText : qst.title(); - text: (qst)? qst.text(): ""; - img: (qst && qst.img().length)? qst.img(): defImg; + titleText : root.qst.title(); + text: (root.qst)? root.qst.text(): ""; + img: (root.qst && root.qst.img().length)? root.qst.img(): defImg; type: 0; x: parent.width / 2 - width / 2; y: parent.height / 2 - height / 2; - width: Math.min(6 * metrix.pt, root.width); + width: Math.min(440, root.width); onAccepted: { - if (model) { - model.questionComplete(true, qst.type()) + if (root.model) { + root.model.questionComplete(true, root.qst.type()) } } onRejected: { - if (model) { - model.questionComplete(false, qst.type()) + if (root.model) { + root.model.questionComplete(false, root.qst.type()) } } } @@ -83,7 +79,7 @@ Item { } Connections { - target: model + target: root.model function onSigShowHistory() { history.open() } diff --git a/ViewSolutions/src/notificationservice.h b/ViewSolutions/src/notificationservice.h index d954141..9f6488c 100644 --- a/ViewSolutions/src/notificationservice.h +++ b/ViewSolutions/src/notificationservice.h @@ -38,6 +38,8 @@ class VIEWSOLUTION_EXPORT NotificationService: public QObject, public iModel Q_PROPERTY(int notificationsCount READ notificationsCount NOTIFY countNotificationsChanged) public: + explicit NotificationService(QObject *ptr = nullptr); + /** * @brief Notify This method return data of the last notify message. * @return return data of the last notify message. @@ -170,7 +172,6 @@ class VIEWSOLUTION_EXPORT NotificationService: public QObject, public iModel private: - explicit NotificationService(QObject *ptr = nullptr); QHash _listners; From 6249fd3781d190695aaca4acfe75cfdde7934181 Mon Sep 17 00:00:00 2001 From: EndrII Date: Mon, 20 Oct 2025 12:57:38 +0200 Subject: [PATCH 5/8] update notification service --- ViewSolutions/src/notificationservice.cpp | 5 ++++- ViewSolutions/src/notificationservice.h | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ViewSolutions/src/notificationservice.cpp b/ViewSolutions/src/notificationservice.cpp index 29fe707..0c136ea 100644 --- a/ViewSolutions/src/notificationservice.cpp +++ b/ViewSolutions/src/notificationservice.cpp @@ -117,11 +117,14 @@ void NotificationService::showHistory() { emit sigShowHistory(); } +void NotificationService::notificationHiden() { + _notify = NotificationData{}; +} + int NotificationService::notificationsCount() const { return _history->rowCount({}); } - QString ViewSolutions::NotificationService::modelId() const { return "NotificationService"; } diff --git a/ViewSolutions/src/notificationservice.h b/ViewSolutions/src/notificationservice.h index 9f6488c..722d3d8 100644 --- a/ViewSolutions/src/notificationservice.h +++ b/ViewSolutions/src/notificationservice.h @@ -133,6 +133,11 @@ class VIEWSOLUTION_EXPORT NotificationService: public QObject, public iModel Q_INVOKABLE void showHistory(); + /** + * @brief notificationHiden this method should invoked every time when the current notification is hiden, automaticaly or by user. + */ + Q_INVOKABLE void notificationHiden(); + /** * @brief notificationsCount - This method used for return count of history notifications. * @return count of history notifications. From 00e9db6bc31f1818800b9bf80e459be60f61459c Mon Sep 17 00:00:00 2001 From: EndrII Date: Tue, 21 Oct 2025 16:57:44 +0200 Subject: [PATCH 6/8] update extandable behavior --- ViewSolutions/ViewSolutions/Extendable.qml | 48 ++++++++-------------- 1 file changed, 16 insertions(+), 32 deletions(-) diff --git a/ViewSolutions/ViewSolutions/Extendable.qml b/ViewSolutions/ViewSolutions/Extendable.qml index c70e96f..3423056 100644 --- a/ViewSolutions/ViewSolutions/Extendable.qml +++ b/ViewSolutions/ViewSolutions/Extendable.qml @@ -22,6 +22,22 @@ Control { property alias extended: extendetArea.visible property int animationDuration: 600 + Behavior on height { + + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } + + Behavior on width { + enabled: root.flow === GridLayout.LeftToRight + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } + contentItem: GridLayout { id: columnLayout columnSpacing: 0 @@ -33,21 +49,6 @@ Control { padding: 0 Layout.alignment: Qt.AlignCenter - Behavior on implicitHeight { - - NumberAnimation { - easing.type: Easing.OutExpo - duration: root.animationDuration - } - } - - Behavior on implicitWidth { - enabled: root.flow === GridLayout.LeftToRight - NumberAnimation { - easing.type: Easing.OutExpo - duration: root.animationDuration - } - } } @@ -56,23 +57,6 @@ Control { padding: 0 id: mainButton - Behavior on implicitHeight { - - NumberAnimation { - easing.type: Easing.OutExpo - duration: root.animationDuration - - } - } - - Behavior on implicitWidth { - enabled: root.flow === GridLayout.LeftToRight - NumberAnimation { - easing.type: Easing.OutExpo - duration: root.animationDuration - - } - } } } } From fac8e2b30632f8b177cdb4854d266ad78b2c0d24 Mon Sep 17 00:00:00 2001 From: EndrII Date: Wed, 22 Oct 2025 15:38:49 +0200 Subject: [PATCH 7/8] update simple errors --- ViewSolutions/ViewSolutions/Extendable.qml | 63 ++++++++++++++-------- ViewSolutions/ViewSolutions/ImageView.qml | 1 + 2 files changed, 43 insertions(+), 21 deletions(-) diff --git a/ViewSolutions/ViewSolutions/Extendable.qml b/ViewSolutions/ViewSolutions/Extendable.qml index 3423056..d6c90d4 100644 --- a/ViewSolutions/ViewSolutions/Extendable.qml +++ b/ViewSolutions/ViewSolutions/Extendable.qml @@ -22,40 +22,61 @@ Control { property alias extended: extendetArea.visible property int animationDuration: 600 - Behavior on height { - - NumberAnimation { - easing.type: Easing.OutExpo - duration: root.animationDuration - } - } - - Behavior on width { - enabled: root.flow === GridLayout.LeftToRight - NumberAnimation { - easing.type: Easing.OutExpo - duration: root.animationDuration - } - } - contentItem: GridLayout { id: columnLayout columnSpacing: 0 rowSpacing: 0 Control { - id: extendetArea - clip: true - padding: 0 Layout.alignment: Qt.AlignCenter + Layout.maximumWidth: root.implicitWidth - root.rightPadding - root.leftPadding + padding: 0 + id: mainButton + Behavior on implicitHeight { + enabled: root.flow !== GridLayout.LeftToRight + + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } + + Behavior on implicitWidth { + enabled: root.flow === GridLayout.LeftToRight + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } } + Control { - Layout.alignment: Qt.AlignCenter + id: extendetArea + clip: true + visible: false padding: 0 - id: mainButton + Layout.alignment: Qt.AlignCenter + Layout.maximumWidth: root.implicitWidth - root.rightPadding - root.leftPadding + + Behavior on implicitHeight { + enabled: root.flow !== GridLayout.LeftToRight + + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } + + Behavior on implicitWidth { + enabled: root.flow === GridLayout.LeftToRight + NumberAnimation { + easing.type: Easing.OutExpo + duration: root.animationDuration + } + } } } diff --git a/ViewSolutions/ViewSolutions/ImageView.qml b/ViewSolutions/ViewSolutions/ImageView.qml index c6975af..6b99a23 100644 --- a/ViewSolutions/ViewSolutions/ImageView.qml +++ b/ViewSolutions/ViewSolutions/ImageView.qml @@ -122,6 +122,7 @@ AbstractButton { source: Image { id: sourceImg source: root.source + mipmap: true clip: true fillMode: Image.PreserveAspectCrop From 1f751d55afcfcb9003999346892679c861eb45dd Mon Sep 17 00:00:00 2001 From: EndrII Date: Fri, 24 Oct 2025 23:56:02 +0200 Subject: [PATCH 8/8] fix normal type of message --- ViewSolutions/src/notificationdata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ViewSolutions/src/notificationdata.h b/ViewSolutions/src/notificationdata.h index c5ad70c..3fa5070 100644 --- a/ViewSolutions/src/notificationdata.h +++ b/ViewSolutions/src/notificationdata.h @@ -26,7 +26,7 @@ class VIEWSOLUTION_EXPORT NotificationData */ enum Type { /// This is message for general notification. - Normal, + Normal = 0, /// This is warning notification. Warning = 1, /// This is critical error notifications.