From bdfbe4abf95f20678f7d9f1a5d9b9424fdfaaf50 Mon Sep 17 00:00:00 2001 From: Yurt Page Date: Sun, 28 Jul 2024 09:26:03 +0300 Subject: [PATCH 1/4] stringutils.cpp: fix missing import --- source/libmvvm_model/mvvm/utils/stringutils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/libmvvm_model/mvvm/utils/stringutils.cpp b/source/libmvvm_model/mvvm/utils/stringutils.cpp index e072e01f9..643a8e4be 100644 --- a/source/libmvvm_model/mvvm/utils/stringutils.cpp +++ b/source/libmvvm_model/mvvm/utils/stringutils.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include From 82f520f7761961d4dd7ea40d20966da468ab38b1 Mon Sep 17 00:00:00 2001 From: Yurt Page Date: Sun, 28 Jul 2024 09:27:58 +0300 Subject: [PATCH 2/4] README.md: fix typos and simplify Installation instructions --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2630e0918..4926a5672 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,15 @@ ## Overview This model-view-viewmodel framework is intended for large Qt based scientific -applications written in C++. Project was created as a playground toward GUI +applications written in C++. The Project was created as a playground toward GUI refactoring of [BornAgain project](https://www.bornagainproject.org). Main features of the framework are: + Application model to store arbitrary data of GUI session. + Serialization of application models to json. -+ Undo/redo based on command pattern. -+ View model to show parts of application model in Qt widgets. Depends on Qt. ++ Undo/redo based on a command pattern. ++ View model to show parts of an application model in Qt widgets. Depends on Qt. + Scientific plotting based on [qcustomplot](https://www.qcustomplot.com/). + Automatic generation of widgets from model content. + Property editors. @@ -34,13 +34,13 @@ Main features of the framework are: ## Installation instructions -``` +```sh git clone --recurse-submodules https://github.com/gpospelov/qt-mvvm.git -mkdir ; cd -cmake ; make -j8; ctest +mkdir ./build; cd ./build +cmake ..; make -j8; ctest -# run one of examples -/bin/collidingmice +# run one of examples from ./build +./bin/collidingmice ``` ## Example @@ -66,7 +66,7 @@ See short animation [here](doc/assets/colliding-mice.gif). The demo shows that `qt-mvvm` library allows to equip the GUI with the serialization and undo/redo and to provide proper model/view relations via relatively small modifications to the original code. Implementing similar -features from the scratch in bare metal Qt would take much more time and the +features from scratch in bare metal Qt would take much more time and the resulting code wouldn't be easily transferable to another project. This and other examples can be found in [examples](examples/README.md) @@ -149,11 +149,11 @@ editing. The library is intended for large GUI applications. The definition of `large` is quite arbitrary and means something in the range 20k - 200k lines of code. The main logic here is that using the additional library for smaller Qt applications -is redundant, Qt has everything that may be required. If small GUI becomes messy +is redundant, Qt has everything that may be required. If a small GUI becomes messy with time, it can always be refactored or even rewritten from scratch. However, when the number of views to show the same data is getting large, and -the GUI enters the range 20k - 200k, this is were a given library might help in +the GUI enters the range 20k–200k, this is where a given library might help in proper separation of data, logic, and UI. When the GUI grows even further, well, developers of such large GUI know already what they need and probably have already implemented similar machinery. From 239afb0d76d3056d249e7f22238280c3ecbc807c Mon Sep 17 00:00:00 2001 From: Yurt Page Date: Sun, 28 Jul 2024 10:38:41 +0300 Subject: [PATCH 3/4] CMakeLists.txt: build tests conditionally --- CMakeLists.txt | 4 +++- thirdparty/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a3087004..24baa3547 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,9 @@ include(configuration) add_subdirectory(source) add_subdirectory(thirdparty) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif(BUILD_TESTING) include(installation) add_subdirectory(examples) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 5832f30c5..e6dd14687 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -1,2 +1,4 @@ -add_subdirectory(gtest) +if(BUILD_TESTING) + add_subdirectory(gtest) +endif(BUILD_TESTING) add_subdirectory(qcustomplot) From dceb643ac8466fa6409d656e7f660463d395c3fb Mon Sep 17 00:00:00 2001 From: august-alt <77973983+august-alt@users.noreply.github.com> Date: Wed, 6 Apr 2022 17:07:29 +0400 Subject: [PATCH 4/4] made example installation conditional --- examples/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 97171d7fc..c96125c95 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -16,9 +16,8 @@ if (MVVM_BUILD_EXAMPLES) add_subdirectory(plotgraphs) add_subdirectory(saveloadproject) add_subdirectory(treeviews) -endif() - -install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples DESTINATION share/mvvm) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples DESTINATION share/mvvm) +endif()