From d232c76da209e69893279423c4147a1bbf757d3c Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Sat, 15 Feb 2025 16:56:48 +0100
Subject: [PATCH 01/11] added plugins classes

---
 src/public/plugin.cpp       | 13 +++++++++++++
 src/public/plugin.h         | 19 +++++++++++++++++++
 src/public/pluginloader.cpp | 13 +++++++++++++
 src/public/pluginloader.h   | 18 ++++++++++++++++++
 4 files changed, 63 insertions(+)
 create mode 100644 src/public/plugin.cpp
 create mode 100644 src/public/plugin.h
 create mode 100644 src/public/pluginloader.cpp
 create mode 100644 src/public/pluginloader.h

diff --git a/src/public/plugin.cpp b/src/public/plugin.cpp
new file mode 100644
index 0000000..15a03f0
--- /dev/null
+++ b/src/public/plugin.cpp
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2025-2025 QuasarApp.
+ * Distributed under the lgplv3 software license, see the accompanying
+ * Everyone is permitted to copy and distribute verbatim copies
+ * of this license document, but changing it is not allowed.
+*/
+
+#include "plugin.h"
+
+namespace QH {
+
+Plugin::Plugin() {}
+}
diff --git a/src/public/plugin.h b/src/public/plugin.h
new file mode 100644
index 0000000..70d9bf0
--- /dev/null
+++ b/src/public/plugin.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2025-2025 QuasarApp.
+ * Distributed under the lgplv3 software license, see the accompanying
+ * Everyone is permitted to copy and distribute verbatim copies
+ * of this license document, but changing it is not allowed.
+*/
+
+#ifndef PLUGIN_H
+#define PLUGIN_H
+
+namespace QH {
+
+class Plugin
+{
+public:
+    Plugin();
+};
+}
+#endif // PLUGIN_H
diff --git a/src/public/pluginloader.cpp b/src/public/pluginloader.cpp
new file mode 100644
index 0000000..debf96a
--- /dev/null
+++ b/src/public/pluginloader.cpp
@@ -0,0 +1,13 @@
+/*
+ * Copyright (C) 2025-2025 QuasarApp.
+ * Distributed under the lgplv3 software license, see the accompanying
+ * Everyone is permitted to copy and distribute verbatim copies
+ * of this license document, but changing it is not allowed.
+*/
+
+
+#include "pluginloader.h"
+namespace QH {
+
+PluginLoader::PluginLoader() {}
+}
diff --git a/src/public/pluginloader.h b/src/public/pluginloader.h
new file mode 100644
index 0000000..6dbfc4f
--- /dev/null
+++ b/src/public/pluginloader.h
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2025-2025 QuasarApp.
+ * Distributed under the lgplv3 software license, see the accompanying
+ * Everyone is permitted to copy and distribute verbatim copies
+ * of this license document, but changing it is not allowed.
+*/
+
+#ifndef PLUGINLOADER_H
+#define PLUGINLOADER_H
+namespace QH {
+
+class PluginLoader
+{
+public:
+    PluginLoader();
+};
+}
+#endif // PLUGINLOADER_H

From 7875cdb6ebea9878c9e2396d95cb81ee6416444a Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Sat, 15 Feb 2025 16:56:48 +0100
Subject: [PATCH 02/11] Revert "added plugins classes"

This reverts commit d232c76da209e69893279423c4147a1bbf757d3c.
---
 src/public/plugin.cpp       | 13 -------------
 src/public/plugin.h         | 19 -------------------
 src/public/pluginloader.cpp | 13 -------------
 src/public/pluginloader.h   | 18 ------------------
 4 files changed, 63 deletions(-)
 delete mode 100644 src/public/plugin.cpp
 delete mode 100644 src/public/plugin.h
 delete mode 100644 src/public/pluginloader.cpp
 delete mode 100644 src/public/pluginloader.h

diff --git a/src/public/plugin.cpp b/src/public/plugin.cpp
deleted file mode 100644
index 15a03f0..0000000
--- a/src/public/plugin.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (C) 2025-2025 QuasarApp.
- * Distributed under the lgplv3 software license, see the accompanying
- * Everyone is permitted to copy and distribute verbatim copies
- * of this license document, but changing it is not allowed.
-*/
-
-#include "plugin.h"
-
-namespace QH {
-
-Plugin::Plugin() {}
-}
diff --git a/src/public/plugin.h b/src/public/plugin.h
deleted file mode 100644
index 70d9bf0..0000000
--- a/src/public/plugin.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2025-2025 QuasarApp.
- * Distributed under the lgplv3 software license, see the accompanying
- * Everyone is permitted to copy and distribute verbatim copies
- * of this license document, but changing it is not allowed.
-*/
-
-#ifndef PLUGIN_H
-#define PLUGIN_H
-
-namespace QH {
-
-class Plugin
-{
-public:
-    Plugin();
-};
-}
-#endif // PLUGIN_H
diff --git a/src/public/pluginloader.cpp b/src/public/pluginloader.cpp
deleted file mode 100644
index debf96a..0000000
--- a/src/public/pluginloader.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-/*
- * Copyright (C) 2025-2025 QuasarApp.
- * Distributed under the lgplv3 software license, see the accompanying
- * Everyone is permitted to copy and distribute verbatim copies
- * of this license document, but changing it is not allowed.
-*/
-
-
-#include "pluginloader.h"
-namespace QH {
-
-PluginLoader::PluginLoader() {}
-}
diff --git a/src/public/pluginloader.h b/src/public/pluginloader.h
deleted file mode 100644
index 6dbfc4f..0000000
--- a/src/public/pluginloader.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright (C) 2025-2025 QuasarApp.
- * Distributed under the lgplv3 software license, see the accompanying
- * Everyone is permitted to copy and distribute verbatim copies
- * of this license document, but changing it is not allowed.
-*/
-
-#ifndef PLUGINLOADER_H
-#define PLUGINLOADER_H
-namespace QH {
-
-class PluginLoader
-{
-public:
-    PluginLoader();
-};
-}
-#endif // PLUGINLOADER_H

From e34e833cc292434a12e5b96cf930d44b76afe1e7 Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Mon, 17 Feb 2025 14:14:06 +0100
Subject: [PATCH 03/11] update docs

---
 src/public/asyncrenderloop.h | 2 +-
 submodules/QuasarAppLib      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/public/asyncrenderloop.h b/src/public/asyncrenderloop.h
index a947bd8..1c3c939 100644
--- a/src/public/asyncrenderloop.h
+++ b/src/public/asyncrenderloop.h
@@ -16,7 +16,7 @@ namespace QH {
  * @brief The AsyncRenderLoop is a class for asynchronous rendering.
  * This class is used to create a render loop that is executed in a separate thread.
  * To use this class, you must inherit from it and implement the renderIteration method.
- * @example :
+ * **example:** :
  * @code{cpp}
  * class MyRenderLoop: public AsyncRenderLoop
  * {
diff --git a/submodules/QuasarAppLib b/submodules/QuasarAppLib
index ebdd860..9c6c6d2 160000
--- a/submodules/QuasarAppLib
+++ b/submodules/QuasarAppLib
@@ -1 +1 @@
-Subproject commit ebdd8605313200c48d74cfba6592ed543135a663
+Subproject commit 9c6c6d257c24f27c281886e2a61d9a83391c2eb3

From 55c80f3e24403f6665f2d7ded25312191cdbd6dd Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Tue, 18 Feb 2025 14:13:16 +0100
Subject: [PATCH 04/11] update qa lib

---
 submodules/QuasarAppLib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/submodules/QuasarAppLib b/submodules/QuasarAppLib
index 9c6c6d2..7e84073 160000
--- a/submodules/QuasarAppLib
+++ b/submodules/QuasarAppLib
@@ -1 +1 @@
-Subproject commit 9c6c6d257c24f27c281886e2a61d9a83391c2eb3
+Subproject commit 7e84073393c2ce09879f19ba4c685adf031e07d1

From 299fbe8e4014638c4c7a9869e343ad6be7664db8 Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Tue, 18 Feb 2025 18:30:36 +0100
Subject: [PATCH 05/11] fix render loop object

---
 src/public/asyncrenderloop.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/public/asyncrenderloop.cpp b/src/public/asyncrenderloop.cpp
index 408ae63..b9d9f86 100644
--- a/src/public/asyncrenderloop.cpp
+++ b/src/public/asyncrenderloop.cpp
@@ -7,6 +7,7 @@
 
 #include "asyncrenderloop.h"
 #include <QThread>
+#include <qdebug.h>
 
 namespace QH {
 
@@ -15,6 +16,8 @@ AsyncRenderLoop::AsyncRenderLoop(QThread *thread, QObject *ptr): Async(thread, p
 
 AsyncRenderLoop::~AsyncRenderLoop() {
     AsyncRenderLoop::stop();
+    delete thread();
+
 }
 
 void QH::AsyncRenderLoop::run() {
@@ -34,6 +37,7 @@ void QH::AsyncRenderLoop::stop() {
     m_run = false;
     thread()->quit();
     thread()->wait();
+
 }
 
 bool AsyncRenderLoop::isRun() const {

From bc9b0a65146a85ec598c0d2df2cfe916117ca749 Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Tue, 18 Feb 2025 20:22:34 +0100
Subject: [PATCH 06/11] added MainSharedPtr class

---
 src/public/asyncrenderloop.cpp | 15 ++++++++--
 src/public/asyncrenderloop.h   | 51 ++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 3 deletions(-)

diff --git a/src/public/asyncrenderloop.cpp b/src/public/asyncrenderloop.cpp
index b9d9f86..34402e7 100644
--- a/src/public/asyncrenderloop.cpp
+++ b/src/public/asyncrenderloop.cpp
@@ -15,7 +15,14 @@ AsyncRenderLoop::AsyncRenderLoop(QThread *thread, QObject *ptr): Async(thread, p
 }
 
 AsyncRenderLoop::~AsyncRenderLoop() {
+
+#ifdef QT_DEBUG
+    Q_ASSERT_X(!isRun(), __FUNCTION__, "try to delete runned render loop! Please stop before delete."
+                                       "If you the SharedPointer,"
+                                       " it should be stoped monualy Or You can use AsyncRenderLoop::MainSharedPtr class");
+#endif
     AsyncRenderLoop::stop();
+
     delete thread();
 
 }
@@ -34,9 +41,11 @@ void QH::AsyncRenderLoop::run() {
 }
 
 void QH::AsyncRenderLoop::stop() {
-    m_run = false;
-    thread()->quit();
-    thread()->wait();
+    if (isRun()) {
+        m_run = false;
+        thread()->quit();
+        thread()->wait();
+    }
 
 }
 
diff --git a/src/public/asyncrenderloop.h b/src/public/asyncrenderloop.h
index 1c3c939..0b61b58 100644
--- a/src/public/asyncrenderloop.h
+++ b/src/public/asyncrenderloop.h
@@ -35,11 +35,62 @@ namespace QH {
  *
  *    return app.exec();
  * @endcode
+ *
+ * @warning This class may be broken if you use it as a QSharedPointer and push WeackPointer to the child objects. To solve this issue use the @a AsyncRenderLoop::MainSharedPtr class.
+ *
+ * Example:
+ *
+ * @code{cpp}
+ * class MyRenderLoop: public AsyncRenderLoop
+ * {
+ * ...
+ * };
+ *
+ * int main (int argc, char* argv[]) {
+ *   auto loop = QSharedPointer<MyRenderLoop>(new MyRenderLoop(new QThread())); // wrong! it will be broken
+ *   auto loop = MyRenderLoop::MainSharedPtr<QSharedPointer<MyRenderLoop>>(QSharedPointer<MyRenderLoop>::create(new QThread())); // right!
+ *  ...
+ *  return app.exec();
+ *  }
+ *  @endcode
  */
 class HEARTSHARED_EXPORT AsyncRenderLoop: public Async
 {
+
     Q_OBJECT
 public:
+
+    /**
+     * @brief The MainSharedPtr class is a helper class for creating a shared pointer to the render loop.
+     * This class make main sharedPointer of your render loop object. it is used to solve issue with deleting object in self thread.
+     *
+     * if you use the AsyncRenderLoop as a QSharedPointer and push WeackPointer to the child objects, you must use this wrapper class.
+     */
+    template<typename T>
+    class MainSharedPtr {
+    public:
+        MainSharedPtr(const T& ptr): _ptr(ptr) {
+            static_assert(std::is_base_of_v<AsyncRenderLoop, typename T::element_type>,
+                          "T must be derived from QSharedPointer<AsyncRender>");
+        }
+        ~MainSharedPtr() {
+            if (_ptr) {
+                _ptr->stop();
+            }
+        }
+
+        typename T::element_type* operator->() const {
+            return _ptr.operator->();
+        }
+
+        typename T::element_type* get() const {
+            return _ptr.get();
+        }
+
+    private:
+        T _ptr;
+    };
+
     AsyncRenderLoop(QThread* thread, QObject* ptr = nullptr);
     ~AsyncRenderLoop();
 

From ac9ba463c7b9a1345a3c1a948f0f32a1ba146b19 Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Wed, 19 Feb 2025 16:03:29 +0100
Subject: [PATCH 07/11] simple fix

---
 src/public/asyncrenderloop.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/public/asyncrenderloop.h b/src/public/asyncrenderloop.h
index 0b61b58..ab91232 100644
--- a/src/public/asyncrenderloop.h
+++ b/src/public/asyncrenderloop.h
@@ -49,6 +49,7 @@ namespace QH {
  * int main (int argc, char* argv[]) {
  *   auto loop = QSharedPointer<MyRenderLoop>(new MyRenderLoop(new QThread())); // wrong! it will be broken
  *   auto loop = MyRenderLoop::MainSharedPtr<QSharedPointer<MyRenderLoop>>(QSharedPointer<MyRenderLoop>::create(new QThread())); // right!
+ *   auto loop = MyRenderLoop::createMainPtr<MyRenderLoop>(new QThread()); // this is short version of initialization Main pointer
  *  ...
  *  return app.exec();
  *  }
@@ -69,6 +70,11 @@ public:
     template<typename T>
     class MainSharedPtr {
     public:
+        MainSharedPtr() {
+            static_assert(std::is_base_of_v<AsyncRenderLoop, typename T::element_type>,
+                          "T must be derived from QSharedPointer<AsyncRender>");
+        }
+
         MainSharedPtr(const T& ptr): _ptr(ptr) {
             static_assert(std::is_base_of_v<AsyncRenderLoop, typename T::element_type>,
                           "T must be derived from QSharedPointer<AsyncRender>");
@@ -83,14 +89,27 @@ public:
             return _ptr.operator->();
         }
 
+        /**
+         * @brief get This is a alias of the QSharedPointer::get method.
+         * @return pointer to the object.
+         */
         typename T::element_type* get() const {
             return _ptr.get();
         }
 
+        /**
+         * @brief getShared This method return child shared pointer. You can use them as a general shared pointer of the object.
+         * @return reference to the object.
+         */
+        const T& getShared() const {
+            return _ptr;
+        }
+
     private:
         T _ptr;
     };
 
+
     AsyncRenderLoop(QThread* thread, QObject* ptr = nullptr);
     ~AsyncRenderLoop();
 
@@ -110,6 +129,18 @@ public:
      */
     bool isRun() const;
 
+    /**
+     * @brief createMainPtr This method creates a shared pointer to the render loop.
+     * @tparam Type type of the render loop object.
+     * @tparam Args arguments for the constructor of the render loop object.
+     * @param arguments arguments for the constructor of the render loop object.
+     * @return shared pointer to the render loop.
+     */
+    template<typename Type, typename... Args>
+    static MainSharedPtr<QSharedPointer<Type>> createMainPtr(Args && ...arguments) {
+        return MainSharedPtr<QSharedPointer<Type>>(QSharedPointer<Type>::create(std::forward<Args>(arguments)...));
+    };
+
 protected:
 
     /**
@@ -130,4 +161,5 @@ private:
 
 };
 }
+
 #endif // ASYNCRENDERLOOP_H

From b4ad53ced97f40ca693b7a2132bb3d0023e5dd6b Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Sun, 23 Feb 2025 19:05:59 +0100
Subject: [PATCH 08/11] update mainPtr

---
 src/public/asyncrenderloop.h | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/src/public/asyncrenderloop.h b/src/public/asyncrenderloop.h
index ab91232..f653c40 100644
--- a/src/public/asyncrenderloop.h
+++ b/src/public/asyncrenderloop.h
@@ -48,7 +48,7 @@ namespace QH {
  *
  * int main (int argc, char* argv[]) {
  *   auto loop = QSharedPointer<MyRenderLoop>(new MyRenderLoop(new QThread())); // wrong! it will be broken
- *   auto loop = MyRenderLoop::MainSharedPtr<QSharedPointer<MyRenderLoop>>(QSharedPointer<MyRenderLoop>::create(new QThread())); // right!
+ *   auto loop = MyRenderLoop::MainSharedPtr<MyRenderLoop>>(new QThread()); // right!
  *   auto loop = MyRenderLoop::createMainPtr<MyRenderLoop>(new QThread()); // this is short version of initialization Main pointer
  *  ...
  *  return app.exec();
@@ -63,6 +63,7 @@ public:
 
     /**
      * @brief The MainSharedPtr class is a helper class for creating a shared pointer to the render loop.
+     * @tparam T type of the render loop object.
      * This class make main sharedPointer of your render loop object. it is used to solve issue with deleting object in self thread.
      *
      * if you use the AsyncRenderLoop as a QSharedPointer and push WeackPointer to the child objects, you must use this wrapper class.
@@ -71,13 +72,13 @@ public:
     class MainSharedPtr {
     public:
         MainSharedPtr() {
-            static_assert(std::is_base_of_v<AsyncRenderLoop, typename T::element_type>,
-                          "T must be derived from QSharedPointer<AsyncRender>");
+            static_assert(std::is_base_of_v<AsyncRenderLoop, T>,
+                          "T must be derived from AsyncRenderLoop");
         }
 
-        MainSharedPtr(const T& ptr): _ptr(ptr) {
-            static_assert(std::is_base_of_v<AsyncRenderLoop, typename T::element_type>,
-                          "T must be derived from QSharedPointer<AsyncRender>");
+        MainSharedPtr(const QSharedPointer<T>& ptr): _ptr(ptr) {
+            static_assert(std::is_base_of_v<AsyncRenderLoop, T>,
+                          "T must be derived from AsyncRenderLoop");
         }
         ~MainSharedPtr() {
             if (_ptr) {
@@ -85,7 +86,7 @@ public:
             }
         }
 
-        typename T::element_type* operator->() const {
+        T* operator->() const {
             return _ptr.operator->();
         }
 
@@ -93,20 +94,30 @@ public:
          * @brief get This is a alias of the QSharedPointer::get method.
          * @return pointer to the object.
          */
-        typename T::element_type* get() const {
+        T* get() const {
             return _ptr.get();
         }
 
+        /**
+         * @brief create This method creates a shared pointer to the render loop.
+         * @param arguments arguments for the constructor of the render loop object.
+         * @return shared pointer to the render loop.
+         */
+        template <typename... Args>
+        [[nodiscard]] static MainSharedPtr create(Args && ...arguments) {
+            return MainSharedPtr(QSharedPointer<T>::create(std::forward<Args>(arguments)...));
+        }
+
         /**
          * @brief getShared This method return child shared pointer. You can use them as a general shared pointer of the object.
          * @return reference to the object.
          */
-        const T& getShared() const {
+        const QSharedPointer<T>& getShared() const {
             return _ptr;
         }
 
     private:
-        T _ptr;
+        QSharedPointer<T> _ptr;
     };
 
 
@@ -137,8 +148,8 @@ public:
      * @return shared pointer to the render loop.
      */
     template<typename Type, typename... Args>
-    static MainSharedPtr<QSharedPointer<Type>> createMainPtr(Args && ...arguments) {
-        return MainSharedPtr<QSharedPointer<Type>>(QSharedPointer<Type>::create(std::forward<Args>(arguments)...));
+    static MainSharedPtr<Type> createMainPtr(Args && ...arguments) {
+        return MainSharedPtr<Type>(QSharedPointer<Type>::create(std::forward<Args>(arguments)...));
     };
 
 protected:

From ba0ab43f87a5bc20bf72a5f3b3b939bface92bcb Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Sat, 1 Mar 2025 10:04:46 +0100
Subject: [PATCH 09/11] remove stream in multiversions

---
 src/public/streammultiversion.cpp | 15 ++++-----
 src/public/streammultiversion.h   | 51 ++++++++++++++++++++++---------
 2 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/src/public/streammultiversion.cpp b/src/public/streammultiversion.cpp
index e664611..6cafb24 100644
--- a/src/public/streammultiversion.cpp
+++ b/src/public/streammultiversion.cpp
@@ -7,18 +7,15 @@ StreamMultiversion::StreamMultiversion() {
 
 }
 
-QDataStream &StreamMultiversion::fromStream(QDataStream &stream) {
-    stream >> _realVersion ;
-    return stream;
+void StreamMultiversion::saveVersion(char version, QDataStream &stream) const {
+    stream << version;
 }
 
-QDataStream &StreamMultiversion::toStream(QDataStream &stream) const {
-    stream << _realVersion;
+char StreamMultiversion::readVersion(QDataStream &stream) const {
+    char version;
+    stream >> version;
 
-    return stream;
-}
+    return version;
 
-int StreamMultiversion::realVersion() const {
-    return _realVersion;
 }
 }
diff --git a/src/public/streammultiversion.h b/src/public/streammultiversion.h
index 744a3e1..c1e5dd5 100644
--- a/src/public/streammultiversion.h
+++ b/src/public/streammultiversion.h
@@ -14,6 +14,26 @@ namespace QH {
 
 /**
  * @brief The StreamMultiversion class this parser works with simple multiversion packages.
+ *
+ * This class used to save and read version of the object in file.
+ *
+ * @see StreamBase
+ *
+ * @code{cpp}
+ * class myClass: public StreamMultiversion {
+ *      protected:
+ *      QDataStream &fromStream(QDataStream &stream) override {
+ *          char version = readVersion();
+ *          return stream;
+ *      }
+ *
+ *      QDataStream &toStream(QDataStream &stream) const override {
+ *          saveVersion(1, stream);
+ *          return stream;
+ *      }
+ *
+ * }
+ *
  */
 class HEARTSHARED_EXPORT StreamMultiversion: public StreamBase
 {
@@ -22,26 +42,27 @@ public:
     StreamMultiversion();
 
     // StreamBase interface
-    /**
-     * @brief version override this method to sets version of package.
-     * @return
-     */
-    virtual int version() const = 0;
 
     /**
-     * @brief realVersion This method return value of the version that was be saved in the bytes array.
-     * @return
-     * @note use this method to check version of read package in the fromStream method..
+     * @brief saveVersion save version of the object to the stream.
+     * @param version - version of the object.
+     * @param stream - stream to save.
+     *
+     * This method used to save version of the object in file.
+     * @see toStream
      */
-    virtual int realVersion() const;
-protected:
-    QDataStream &fromStream(QDataStream &stream) override;
-    QDataStream &toStream(QDataStream &stream) const override;
+    void saveVersion(char version, QDataStream &stream) const;
+
+    /**
+     * @brief readVersion read version of the object from the stream.
+     * @param stream - stream to read.
+     * @return version of the object.
+     * @see fromStream
+
+     */
+    char readVersion(QDataStream &stream) const;
 
 
-
-private:
-    int _realVersion = 0;
 };
 }
 #endif // STREAMMULTIVERSION_H

From 6864f5b00bda55df81aed07eae2987dede9c9d39 Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Sun, 2 Mar 2025 15:15:30 +0100
Subject: [PATCH 10/11] fix constructor and distructor

---
 src/public/streammultiversion.cpp | 4 ++++
 src/public/streammultiversion.h   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/public/streammultiversion.cpp b/src/public/streammultiversion.cpp
index 6cafb24..87ae7fc 100644
--- a/src/public/streammultiversion.cpp
+++ b/src/public/streammultiversion.cpp
@@ -7,6 +7,10 @@ StreamMultiversion::StreamMultiversion() {
 
 }
 
+StreamMultiversion::~StreamMultiversion() {
+
+}
+
 void StreamMultiversion::saveVersion(char version, QDataStream &stream) const {
     stream << version;
 }
diff --git a/src/public/streammultiversion.h b/src/public/streammultiversion.h
index c1e5dd5..208b7a1 100644
--- a/src/public/streammultiversion.h
+++ b/src/public/streammultiversion.h
@@ -40,7 +40,7 @@ class HEARTSHARED_EXPORT StreamMultiversion: public StreamBase
 public:
 
     StreamMultiversion();
-
+    ~StreamMultiversion();
     // StreamBase interface
 
     /**

From 402bee747ca479adbaf6cb3a95e72fa14ff9ec49 Mon Sep 17 00:00:00 2001
From: EndrII <EndrIIMail@gmail.com>
Date: Tue, 4 Mar 2025 21:48:00 +0100
Subject: [PATCH 11/11] update

---
 src/public/streammultiversion.cpp | 2 +-
 src/public/streammultiversion.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/public/streammultiversion.cpp b/src/public/streammultiversion.cpp
index 87ae7fc..dbf1750 100644
--- a/src/public/streammultiversion.cpp
+++ b/src/public/streammultiversion.cpp
@@ -15,7 +15,7 @@ void StreamMultiversion::saveVersion(char version, QDataStream &stream) const {
     stream << version;
 }
 
-char StreamMultiversion::readVersion(QDataStream &stream) const {
+char StreamMultiversion::readVersion(QDataStream &stream) {
     char version;
     stream >> version;
 
diff --git a/src/public/streammultiversion.h b/src/public/streammultiversion.h
index 208b7a1..0030335 100644
--- a/src/public/streammultiversion.h
+++ b/src/public/streammultiversion.h
@@ -60,7 +60,7 @@ public:
      * @see fromStream
 
      */
-    char readVersion(QDataStream &stream) const;
+    char readVersion(QDataStream &stream);
 
 
 };