Переделано под один мега-проект LMS с общим CMakeLists.txt

This commit is contained in:
krivoshein
2025-01-15 12:34:56 +03:00
parent 3064818931
commit 1c93b1f94d
219 changed files with 68 additions and 51 deletions

View File

@@ -0,0 +1,86 @@
cmake_minimum_required(VERSION 3.5)
project(DataBaseLMS LANGUAGES CXX)
get_filename_component(REPO_PATH ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(PROJECT_TYPE_DEBUG TRUE)
endif()
if(PROJECT_TYPE_DEBUG)
add_definitions(-DPROJECT_TYPE_DEBUG)
endif()
find_package(Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt5 COMPONENTS Sql REQUIRED)
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
add_library(DataBaseLMS SHARED
DataBaseLMS_global.h
databaselms.cpp
databaselms.h
interfacedatabaselms.cpp
interfacedatabaselms.h
basicentity.cpp
basicentity.h
user.cpp
user.h
instructor.cpp
instructor.h
trainee.cpp
trainee.h
group.cpp
group.h
computer.cpp
computer.h
task.cpp
task.h
classroom.cpp
classroom.h
)
target_link_libraries(DataBaseLMS PRIVATE Qt5::Widgets)
target_link_libraries(DataBaseLMS PRIVATE Qt5::Sql)
target_compile_definitions(DataBaseLMS PRIVATE DATABASELMS_LIBRARY)
message("${REPO_PATH}")
if(PROJECT_TYPE_DEBUG)
add_custom_command(TARGET DataBaseLMS
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${REPO_PATH}/BUILDS/Debug64/DataBaseLMS/libDataBaseLMS.dll
${REPO_PATH}/BUILDS/Debug64/TestServerLMS)
add_custom_command(TARGET DataBaseLMS
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${REPO_PATH}/BUILDS/Debug64/DataBaseLMS/libDataBaseLMS.dll
${REPO_PATH}/BUILDS/Debug64/GUIdataBaseLMS)
elseif()
add_custom_command(TARGET DataBaseLMS
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${REPO_PATH}/BUILDS/Release64/DataBaseLMS/libDataBaseLMS.dll
${REPO_PATH}/BUILDS/Release64/TestServerLMS)
add_custom_command(TARGET DataBaseLMS
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${REPO_PATH}/BUILDS/Release64/DataBaseLMS/libDataBaseLMS.dll
${REPO_PATH}/BUILDS/Release64/GUIdataBaseLMS)
endif()

View File

@@ -0,0 +1,347 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2024-12-28T11:57:36. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{00ce76f6-77cf-4587-a216-9a8e243377cb}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/BUILDS/LMS/DB_LMS/Debug64</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/LMS/DB_LMS/Release64</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/LMS/DB/build-DataBaseLMS-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/LMS/DB/build-DataBaseLMS-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

View File

@@ -0,0 +1,390 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2025-01-10T12:59:06. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{15ef2478-2444-4b00-88b8-fead51c6fef5}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 64-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win64_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">4</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Release</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/DB_LMS/build-DataBaseLMS-Desktop_Qt_5_14_2_MinGW_64_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/DB_LMS/build-DataBaseLMS-Desktop_Qt_5_14_2_MinGW_64_bit-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск с отладочной информацией</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/DB_LMS/build-DataBaseLMS-Desktop_Qt_5_14_2_MinGW_64_bit-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Выпуск минимального размера</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/BUILDS/DB_LMS/Debug64</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Отладка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.4">
<valuelist type="QVariantList" key="CMake.Configuration">
<value type="QString">CMAKE_BUILD_TYPE:STRING=Debug</value>
<value type="QString">CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString">CMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}</value>
<value type="QString">CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString">QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}</value>
</valuelist>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/QT/Projects/RRJServer/RRJServer/BUILDS/DB_LMS/Debug64</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Сборка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.AdditionalArguments"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Очистка</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">5</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Развёртывание</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Развёртывание</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

View File

@@ -0,0 +1,12 @@
#ifndef DATABASELMS_GLOBAL_H
#define DATABASELMS_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(DATABASELMS_LIBRARY)
# define DATABASELMS_EXPORT Q_DECL_EXPORT
#else
# define DATABASELMS_EXPORT Q_DECL_IMPORT
#endif
#endif // DATABASELMS_GLOBAL_H

View File

@@ -0,0 +1,14 @@
#include "basicentity.h"
BasicEntity::BasicEntity():
id(),
name()
{
}
BasicEntity::BasicEntity(int id, QString name)
{
this->id = id;
this->name = name;
}

24
DataBaseLMS/basicentity.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef BASICENTITY_H
#define BASICENTITY_H
#include <QString>
#include "DataBaseLMS_global.h"
class BasicEntity
{
public:
BasicEntity();
BasicEntity(int id, QString name);
void setID(int id){this->id = id;}
int getID(){return id;}
void setName(QString name){this->name = name;}
QString getName(){return name;}
protected:
int id;
QString name;
};
#endif // BASICENTITY_H

13
DataBaseLMS/classroom.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include "classroom.h"
Classroom::Classroom():
BasicEntity()
{
}
Classroom::Classroom(int id, QString name):
BasicEntity(id, name)
{
}

13
DataBaseLMS/classroom.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef CLASSROOM_H
#define CLASSROOM_H
#include "basicentity.h"
class DATABASELMS_EXPORT Classroom: public BasicEntity
{
public:
Classroom();
Classroom(int id, QString name);
};
#endif // CLASSROOM_H

16
DataBaseLMS/computer.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include "computer.h"
Computer::Computer():
BasicEntity(),
classroom(),
ipAddress()
{
}
Computer::Computer(int id, QString name, QString ipAddress, Classroom classroom):
BasicEntity(id, name)
{
this->ipAddress = ipAddress;
this->classroom = classroom;
}

24
DataBaseLMS/computer.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef COMPUTER_H
#define COMPUTER_H
#include "basicentity.h"
#include "classroom.h"
class DATABASELMS_EXPORT Computer: public BasicEntity
{
public:
Computer();
Computer(int id, QString name, QString ipAddress, Classroom classroom);
void setClassroom(Classroom classroom){this->classroom = classroom;}
Classroom getClassroom(){return classroom;}
void setIpAddress(QString ipAddress){this->ipAddress = ipAddress;}
QString getIpAddress(){return ipAddress;}
private:
Classroom classroom;
QString ipAddress;
};
#endif // COMPUTER_H

817
DataBaseLMS/databaselms.cpp Normal file
View File

@@ -0,0 +1,817 @@
#include "databaselms.h"
#include <QtSql>
#include <QSqlDatabase>
#include <QMessageBox>
DataBaseLMS::DataBaseLMS():
db(nullptr),
transactionBegined(false)
{
}
DataBaseLMS::~DataBaseLMS()
{
deleteConnection();
}
bool DataBaseLMS::createConnection()
{
mtxAccess.lock();
db = new QSqlDatabase(QSqlDatabase::addDatabase(dbType));
db->setDatabaseName(dbName);
db->setUserName(dbUserName);
db->setPassword(dbPassword);
db->setPort(5432);
db->setHostName("192.168.100.87");
if(!db->open())
{
mtxAccess.unlock();
deleteConnection();
return false;
}
else
{
mtxAccess.unlock();
return true;
}
}
void DataBaseLMS::deleteConnection()
{
mtxAccess.lock();
if(transactionBegined)
QSqlDatabase::database().rollback();
if(db != nullptr)
{
if(db->isOpen())
db->close();
delete db;
db = nullptr;
}
mtxAccess.unlock();
}
bool DataBaseLMS::isConnected()
{
mtxAccess.lock();
if(db == nullptr)
{
mtxAccess.unlock();
return false;
}
else
{
if(db->isOpen())
{
mtxAccess.unlock();
return true;
}
}
mtxAccess.unlock();
return false;
}
bool DataBaseLMS::transactionBegin()
{
/*
if(transactionBegined)
QSqlDatabase::database().rollback();
transactionBegined = true;
return QSqlDatabase::database().transaction();
*/
return true;
}
bool DataBaseLMS::transactionEnd()
{
/*
if(transactionBegined)
{
transactionBegined = false;
return QSqlDatabase::database().commit();
}
return false;
*/
return true;
}
QList<Instructor> DataBaseLMS::selectAllInstructors()
{
QList<Instructor> listInstructors;
QString queryStr = QString("SELECT instructor_id, name, login, password, is_admin, archived, logged_in "
"FROM public.instructors "
"ORDER BY instructor_id ASC");
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
while (query.next())
{//Инструктор
Instructor instructor;
instructor.setID(query.value(0).toInt());
instructor.setName(query.value(1).toString());
instructor.setLogin(query.value(2).toString());
instructor.setPassword(query.value(3).toString());
instructor.setIsAdmin(query.value(4).toBool());
instructor.setArchived(query.value(5).toBool());
instructor.setLoggedIn(query.value(6).toBool());
listInstructors.append(instructor);
}
}
return listInstructors;
}
QList<Trainee> DataBaseLMS::selectAllTrainees()
{
QList<Trainee> listTrainees;
QString queryStr = QString("SELECT trainees.trainee_id, trainees.name, trainees.login, trainees.password, trainees.archived, trainees.logged_in, "
"groups.group_id, groups.name, "
"computers.computer_id, computers.name, computers.ip_address, "
"classrooms.classroom_id, classrooms.name "
"FROM public.trainees JOIN public.groups ON groups.group_id = trainees.group_trainee "
"LEFT OUTER JOIN public.computers ON computers.computer_id = trainees.computer_trainee "
"LEFT OUTER JOIN public.classrooms ON classrooms.classroom_id = computers.classroom_computer "
"ORDER BY groups.name, trainees.name ASC");
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
while (query.next())
{//Обучаемый
Trainee trainee;
trainee.setID(query.value(0).toInt());
trainee.setName(query.value(1).toString());
trainee.setLogin(query.value(2).toString());
trainee.setPassword(query.value(3).toString());
trainee.setArchived(query.value(4).toBool());
trainee.setLoggedIn(query.value(5).toBool());
Group group = Group(query.value(6).toInt(), query.value(7).toString());
trainee.setGroup(group);
Classroom classroom = Classroom(query.value(11).toInt(), query.value(12).toString());
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
trainee.setComputer(computer);
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
listTrainees.append(trainee);
}
}
return listTrainees;
}
QList<Group> DataBaseLMS::selectAllGroups()
{
QList<Group> listGroups;
QString queryStr = QString("SELECT group_id, name "
"FROM public.groups "
"ORDER BY group_id ASC");
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
while (query.next())
{//Группа
Group group;
group.setID(query.value(0).toInt());
group.setName(query.value(1).toString());
listGroups.append(group);
}
}
return listGroups;
}
Instructor DataBaseLMS::selectInstructor(int id_instructor)
{
Instructor instructor;
QString queryStr = QString("SELECT instructor_id, name, login, password, is_admin, archived, logged_in "
"FROM public.instructors "
"WHERE instructors.instructor_id = %1 ").arg(
id_instructor);
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if (query.first())
{//Инструктор
instructor.setID(query.value(0).toInt());
instructor.setName(query.value(1).toString());
instructor.setLogin(query.value(2).toString());
instructor.setPassword(query.value(3).toString());
instructor.setIsAdmin(query.value(4).toBool());
instructor.setArchived(query.value(5).toBool());
instructor.setLoggedIn(query.value(6).toBool());
}
}
return instructor;
}
int DataBaseLMS::selectInstructorID(QString login, QString password)
{
QString queryStr;
if(password != QStringLiteral(""))
{
queryStr = QString("SELECT instructors.instructor_id "
"FROM public.instructors "
"WHERE login = '%1' AND password = '%2' ").arg(
login,
password );
}
else
{
queryStr = QString("SELECT instructors.instructor_id "
"FROM public.instructors "
"WHERE login = '%1' ").arg(
login );
}
return queryExecInt(queryStr);
}
QString DataBaseLMS::selectInstructorNameByLogin(QString login)
{
QString queryStr = QString("SELECT instructors.name "
"FROM public.instructors "
"WHERE instructors.login = '%1' ").arg(
login );
return queryExecString(queryStr);
}
bool DataBaseLMS::selectInstructorIsAdmin(int id_instructor)
{
QString queryStr = QString("SELECT instructors.is_admin "
"FROM public.instructors "
"WHERE instructor_id = %1 ").arg(
id_instructor );
return queryExecBool(queryStr);
}
bool DataBaseLMS::selectInstructorLoggedIn(int id_instructor)
{
QString queryStr = QString("SELECT instructors.logged_in "
"FROM public.instructors "
"WHERE instructor_id = %1 ").arg(
id_instructor );
return queryExecBool(queryStr);
}
bool DataBaseLMS::selectInstructorArchived(int id_instructor)
{
QString queryStr = QString("SELECT instructors.archived "
"FROM public.instructors "
"WHERE instructor_id = %1 ").arg(
id_instructor );
return queryExecBool(queryStr);
}
int DataBaseLMS::updateInstructorLoggedIn(int id_instructor, bool loggedIn)
{
QString queryStr = QString("UPDATE public.instructors "
"SET logged_in = %1 "
"WHERE instructor_id = %2 "
"RETURNING instructors.instructor_id").arg(
loggedIn ? "true" : "false",
QString::number(id_instructor) );
return queryExecInt(queryStr);
}
bool DataBaseLMS::updateAllInstructorsLoggedIn(bool loggedIn)
{
QString queryStr = QString("UPDATE public.instructors "
"SET logged_in = %1 ").arg(
loggedIn ? "true" : "false");
QSqlQuery query = QSqlQuery(*db);
return queryExec(queryStr, &query);
}
int DataBaseLMS::updateInstructorArchived(int id_instructor, bool archived)
{
QString queryStr = QString("UPDATE public.instructors "
"SET archived = %1 "
"WHERE instructor_id = %2 "
"RETURNING instructors.instructor_id").arg(
archived ? "true" : "false",
QString::number(id_instructor) );
return queryExecInt(queryStr);
}
int DataBaseLMS::insertInstructor()
{
QString queryStr = QString("INSERT INTO public.instructors "
"DEFAULT VALUES "
"RETURNING instructor_id");
return queryExecInt(queryStr);
}
int DataBaseLMS::insertInstructor(Instructor instructor)
{
QString queryStr = QString("INSERT INTO public.instructors (name, login, password, is_admin, archived, logged_in) "
"VALUES ('%1', '%2', '%3', %4, %5, %6) "
"RETURNING instructor_id").arg(
instructor.getName(),
instructor.getLogin(),
instructor.getPassword(),
instructor.getIsAdmin() ? "true" : "false",
instructor.getArchived() ? "true" : "false",
instructor.getLoggedIn() ? "true" : "false");
return queryExecInt(queryStr);
}
int DataBaseLMS::deleteInstructor(int id_instructor)
{
QString queryStr = QString("DELETE FROM public.instructors "
"WHERE instructor_id = %1 "
"RETURNING instructors.instructor_id").arg(
QString::number(id_instructor));
return queryExecInt(queryStr);
}
int DataBaseLMS::updateInstructor(Instructor instructor)
{
QString queryStr = QString("UPDATE public.instructors "
"SET name = '%1', login = '%2', password = '%3', is_admin = %4, archived = %5, logged_in = %6 "
"WHERE instructor_id = %7 "
"RETURNING instructors.instructor_id").arg(
instructor.getName(),
instructor.getLogin(),
instructor.getPassword(),
instructor.getIsAdmin() ? "true" : "false",
instructor.getArchived() ? "true" : "false",
instructor.getLoggedIn() ? "true" : "false",
QString::number(instructor.getID()) );
return queryExecInt(queryStr);
}
Group DataBaseLMS::selectGroup(int id_group)
{
Group group;
QString queryStr = QString("SELECT group_id, name "
"FROM public.groups "
"WHERE groups.group_id = %1 ").arg(
id_group);
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if (query.first())
{//Инструктор
group.setID(query.value(0).toInt());
group.setName(query.value(1).toString());
}
}
return group;
}
int DataBaseLMS::insertGroup()
{
QString queryStr = QString("INSERT INTO public.groups "
"DEFAULT VALUES "
"RETURNING group_id");
return queryExecInt(queryStr);
}
int DataBaseLMS::insertGroup(Group group)
{
QString queryStr = QString("INSERT INTO public.groups (name) "
"VALUES ('%1') "
"RETURNING groups.group_id").arg(
group.getName());
return queryExecInt(queryStr);
}
int DataBaseLMS::deleteGroup(int group_id)
{
QString queryStr = QString("DELETE FROM public.groups "
"WHERE group_id = %1 "
"RETURNING groups.group_id").arg(
QString::number(group_id));
return queryExecInt(queryStr);
}
int DataBaseLMS::updateGroup(Group group)
{
QString queryStr = QString("UPDATE public.groups SET name = '%1' "
"WHERE group_id = %2 "
"RETURNING groups.group_id").arg(
group.getName(),
QString::number(group.getID()) );
return queryExecInt(queryStr);
}
Trainee DataBaseLMS::selectTrainee(int id_trainee)
{
Trainee trainee;
QString queryStr = QString("SELECT trainees.trainee_id, trainees.name, trainees.login, trainees.password, trainees.archived, trainees.logged_in, "
"groups.group_id, groups.name, "
"computers.computer_id, computers.name, computers.ip_address, "
"classrooms.classroom_id, classrooms.name "
"FROM public.trainees JOIN public.groups ON groups.group_id = trainees.group_trainee "
"LEFT OUTER JOIN public.computers ON computers.computer_id = trainees.computer_trainee "
"LEFT OUTER JOIN public.classrooms ON classrooms.classroom_id = computers.classroom_computer "
"WHERE trainees.trainee_id = %1 "
"ORDER BY groups.name, trainees.name ASC").arg(
id_trainee);
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if (query.first())
{//Инструктор
trainee.setID(query.value(0).toInt());
trainee.setName(query.value(1).toString());
trainee.setLogin(query.value(2).toString());
trainee.setPassword(query.value(3).toString());
trainee.setArchived(query.value(4).toBool());
trainee.setLoggedIn(query.value(5).toBool());
Group group = Group(query.value(6).toInt(), query.value(7).toString());
trainee.setGroup(group);
Classroom classroom = Classroom(query.value(11).toInt(), query.value(12).toString());
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
trainee.setComputer(computer);
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
}
}
return trainee;
}
QList<Trainee> DataBaseLMS::selectAllTraineesInGroup(int id_group)
{
QList<Trainee> listTrainees;
QString queryStr = QString("SELECT trainees.trainee_id, trainees.name, trainees.login, trainees.password, trainees.archived, trainees.logged_in, "
"groups.group_id, groups.name, "
"computers.computer_id, computers.name, computers.ip_address, "
"classrooms.classroom_id, classrooms.name "
"FROM public.trainees JOIN public.groups ON groups.group_id = trainees.group_trainee "
"LEFT OUTER JOIN public.computers ON computers.computer_id = trainees.computer_trainee "
"LEFT OUTER JOIN public.classrooms ON classrooms.classroom_id = computers.classroom_computer "
"WHERE trainees.group_trainee = %1 "
"ORDER BY groups.name, trainees.name ASC").arg(
id_group);
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
while (query.next())
{//Обучаемый
Trainee trainee;
trainee.setID(query.value(0).toInt());
trainee.setName(query.value(1).toString());
trainee.setLogin(query.value(2).toString());
trainee.setPassword(query.value(3).toString());
trainee.setArchived(query.value(4).toBool());
trainee.setLoggedIn(query.value(5).toBool());
Group group = Group(query.value(6).toInt(), query.value(7).toString());
trainee.setGroup(group);
Classroom classroom = Classroom(query.value(11).toInt(), query.value(12).toString());
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
trainee.setComputer(computer);
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
listTrainees.append(trainee);
}
}
return listTrainees;
}
int DataBaseLMS::selectTraineeID(QString login, QString password)
{
QString queryStr;
if(password != QStringLiteral(""))
{
queryStr = QString("SELECT trainees.trainee_id "
"FROM public.trainees "
"WHERE login = '%1' AND password = '%2' ").arg(
login,
password );
}
else
{
queryStr = QString("SELECT trainees.trainee_id "
"FROM public.trainees "
"WHERE login = '%1' ").arg(
login );
}
return queryExecInt(queryStr);
}
QString DataBaseLMS::selectTraineeNameByLogin(QString login)
{
QString queryStr = QString("SELECT trainees.name "
"FROM public.trainees "
"WHERE trainees.login = '%1' ").arg(
login );
return queryExecString(queryStr);
}
QString DataBaseLMS::selectTraineeNameOnComputer(QString computer_name)
{
QString queryStr = QString("SELECT trainees.name "
"FROM public.trainees JOIN public.computers ON computers.computer_id = trainees.computer_trainee "
"WHERE computers.name = '%1' ").arg(
computer_name);
return queryExecString(queryStr);
}
Trainee DataBaseLMS::selectTraineeOnComputer(QString computer_name)
{
Trainee trainee;
QString queryStr = QString("SELECT trainees.trainee_id, trainees.name, trainees.login, trainees.password, trainees.archived, trainees.logged_in, "
"groups.group_id, groups.name, "
"computers.computer_id, computers.name, computers.ip_address, "
"classrooms.classroom_id, classrooms.name "
"FROM public.trainees JOIN public.groups ON groups.group_id = trainees.group_trainee "
"LEFT OUTER JOIN public.computers ON computers.computer_id = trainees.computer_trainee "
"LEFT OUTER JOIN public.classrooms ON classrooms.classroom_id = computers.classroom_computer "
"WHERE computers.name = '%1' ").arg(
computer_name);
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if (query.first())
{//Инструктор
trainee.setID(query.value(0).toInt());
trainee.setName(query.value(1).toString());
trainee.setLogin(query.value(2).toString());
trainee.setPassword(query.value(3).toString());
trainee.setArchived(query.value(4).toBool());
trainee.setLoggedIn(query.value(5).toBool());
Group group = Group(query.value(6).toInt(), query.value(7).toString());
trainee.setGroup(group);
Classroom classroom = Classroom(query.value(11).toInt(), query.value(12).toString());
Computer computer = Computer(query.value(8).toInt(), query.value(9).toString(), query.value(10).toString(), classroom);
trainee.setComputer(computer);
trainee.setTasks(selectTasksOfTrainee(trainee.getID()));
}
}
return trainee;
}
bool DataBaseLMS::selectTraineeArchived(int id_trainee)
{
QString queryStr = QString("SELECT trainees.archived "
"FROM public.trainees "
"WHERE trainee_id = %1 ").arg(
id_trainee );
return queryExecBool(queryStr);
}
bool DataBaseLMS::selectTraineeLoggedIn(int id_trainee)
{
QString queryStr = QString("SELECT trainees.logged_in "
"FROM public.trainees "
"WHERE trainee_id = %1 ").arg(
id_trainee );
return queryExecBool(queryStr);
}
int DataBaseLMS::updateTraineeLoggedIn(int id_trainee, bool loggedIn)
{
QString queryStr = QString("UPDATE public.trainees "
"SET logged_in = %1 "
"WHERE trainee_id = %2 "
"RETURNING trainees.trainee_id").arg(
loggedIn ? "true" : "false",
QString::number(id_trainee) );
return queryExecInt(queryStr);
}
bool DataBaseLMS::updateAllTraineesLoggedIn(bool loggedIn)
{
QString queryStr = QString("UPDATE public.trainees "
"SET logged_in = %1 ").arg(
loggedIn ? "true" : "false");
QSqlQuery query = QSqlQuery(*db);
return queryExec(queryStr, &query);
}
int DataBaseLMS::updateTraineeArchived(int id_trainee, bool archived)
{
QString queryStr = QString("UPDATE public.trainees "
"SET archived = %1 "
"WHERE trainee_id = %2 "
"RETURNING trainees.trainee_id").arg(
archived ? "true" : "false",
QString::number(id_trainee) );
return queryExecInt(queryStr);
}
int DataBaseLMS::insertTrainee(int id_group)
{
QString queryStr = QString("INSERT INTO public.trainees (name, login, password, archived, logged_in, group_trainee) "
"VALUES (DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, %1) "
"RETURNING trainees.trainee_id").arg(
QString::number(id_group));
return queryExecInt(queryStr);
}
int DataBaseLMS::insertTrainee(Trainee trainee)
{
QString queryStr = QString("INSERT INTO public.trainees (name, login, password, archived, logged_in, group_trainee) "
"VALUES ('%1', '%2', '%3', %4, %5, %6) "
"RETURNING trainees.trainee_id").arg(
trainee.getName(),
trainee.getLogin(),
trainee.getPassword(),
trainee.getArchived() ? "true" : "false",
trainee.getLoggedIn() ? "true" : "false",
QString::number(trainee.getGroup().getID()));
return queryExecInt(queryStr);
}
int DataBaseLMS::deleteTrainee(int trainee_id)
{
QString queryStr = QString("DELETE FROM public.trainees "
"WHERE trainee_id = %1 "
"RETURNING trainees.trainee_id").arg(
QString::number(trainee_id));
return queryExecInt(queryStr);
}
int DataBaseLMS::updateTrainee(Trainee trainee)
{
QString computer_id = (trainee.getComputer().getID() == 0 ? QStringLiteral("null") : QString::number(trainee.getComputer().getID()));
QString queryStr = QString("UPDATE public.trainees "
"SET name = '%1', login = '%2', password = '%3', archived = %4, logged_in = %5, "
"group_trainee = %6, "
"computer_trainee = %7 "
"WHERE trainee_id = %8 "
"RETURNING trainees.trainee_id").arg(
trainee.getName(),
trainee.getLogin(),
trainee.getPassword(),
trainee.getArchived() ? "true" : "false",
trainee.getLoggedIn() ? "true" : "false",
QString::number(trainee.getGroup().getID()),
computer_id,
QString::number(trainee.getID()) );
return queryExecInt(queryStr);
}
QList<Task> DataBaseLMS::selectTasksOfTrainee(int trainee_id)
{
QList<Task> tasks;
QString queryStr = QString("SELECT tasks.task_id, tasks.name "
"FROM public.trainees "
"JOIN public.trainees_tasks ON trainees_tasks.trainee_id = trainees.trainee_id "
"JOIN public.tasks ON tasks.task_id = trainees_tasks.task_id "
"WHERE trainees.trainee_id = %1 "
"ORDER BY tasks.name ASC").arg(
trainee_id);
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
while (query.next())
{//Задача
Task task;
task.setID(query.value(0).toInt());
task.setName(query.value(1).toString());
tasks.append(task);
}
}
return tasks;
}
int DataBaseLMS::queryExecInt(QString queryStr)
{
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if(query.first())
return query.value(0).toInt();
}
return 0;
}
QString DataBaseLMS::queryExecString(QString queryStr)
{
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if(query.first())
return query.value(0).toString();
}
return QStringLiteral("");
}
bool DataBaseLMS::queryExecBool(QString queryStr)
{
QSqlQuery query = QSqlQuery(*db);
if(queryExec(queryStr, &query))
{
if(query.first())
return query.value(0).toBool();
}
return false;
}
bool DataBaseLMS::queryExec(QString queryStr, QSqlQuery *query)
{
bool res = false;
mtxAccess.lock();
if(! (res = query->exec(queryStr)) )
messageWarningErrorQuery(queryStr, query);
mtxAccess.unlock();
return res;
}
void DataBaseLMS::messageWarningErrorQuery(QString queryStr, QSqlQuery* query)
{
QMessageBox::warning(nullptr, dbName,
"Error query:\n" + query->lastError().text() + "\n" +
"String of query:\n" + queryStr + "\n" +
"Executed query:\n" + query->executedQuery());
}

94
DataBaseLMS/databaselms.h Normal file
View File

@@ -0,0 +1,94 @@
#ifndef DATABASELMS_H
#define DATABASELMS_H
#include <QSqlDatabase>
#include <QMutex>
#include "instructor.h"
#include "trainee.h"
#include "group.h"
class DataBaseLMS
{
public:
DataBaseLMS();
~DataBaseLMS();
protected:
//Подключение
bool createConnection();
void deleteConnection();
bool isConnected();
//Транзакции
bool transactionBegin();
bool transactionEnd();
//Списки
QList<Instructor> selectAllInstructors();
QList<Trainee> selectAllTrainees();
QList<Group> selectAllGroups();
//Инструктор
Instructor selectInstructor(int id_instructor);
int selectInstructorID(QString login, QString password = QStringLiteral(""));
QString selectInstructorNameByLogin(QString login);
bool selectInstructorIsAdmin(int id_instructor);
bool selectInstructorLoggedIn(int id_instructor);
bool selectInstructorArchived(int id_instructor);
int updateInstructorLoggedIn(int id_instructor, bool loggedIn);
bool updateAllInstructorsLoggedIn(bool loggedIn);
int updateInstructorArchived(int id_instructor, bool archived);
int insertInstructor();
int insertInstructor(Instructor instructor);
int deleteInstructor(int id_instructor);
int updateInstructor(Instructor instructor);
//Группа
Group selectGroup(int id_group);
int insertGroup();
int insertGroup(Group group);
int deleteGroup(int group_id);
int updateGroup(Group group);
//Обучаемый
Trainee selectTrainee(int id_trainee);
QList<Trainee> selectAllTraineesInGroup(int id_group);
int selectTraineeID(QString login, QString password = QStringLiteral(""));
QString selectTraineeNameByLogin(QString login);
QString selectTraineeNameOnComputer(QString computer_name);
Trainee selectTraineeOnComputer(QString computer_name);
bool selectTraineeArchived(int id_trainee);
bool selectTraineeLoggedIn(int id_trainee);
int updateTraineeLoggedIn(int id_trainee, bool loggedIn);
bool updateAllTraineesLoggedIn(bool loggedIn);
int updateTraineeArchived(int id_trainee, bool archived);
int insertTrainee(int id_group);
int insertTrainee(Trainee trainee);
int deleteTrainee(int trainee_id);
int updateTrainee(Trainee trainee);
QList<Task> selectTasksOfTrainee(int trainee_id);
private:
int queryExecInt(QString queryStr);
QString queryExecString(QString queryStr);
bool queryExecBool(QString queryStr);
bool queryExec(QString queryStr, QSqlQuery* query);
void messageWarningErrorQuery(QString queryStr, QSqlQuery* query);
protected:
QSqlDatabase* db;
const QString dbName = "DataBaseLMS";
private:
bool transactionBegined;
const QString dbUserName = "postgres";
const QString dbPassword = "12345678";
const QString dbType = "QPSQL";
QMutex mtxAccess;
};
#endif // DATABASELMS_H

13
DataBaseLMS/group.cpp Normal file
View File

@@ -0,0 +1,13 @@
#include "group.h"
Group::Group():
BasicEntity()
{
}
Group::Group(int id, QString name):
BasicEntity(id, name)
{
}

13
DataBaseLMS/group.h Normal file
View File

@@ -0,0 +1,13 @@
#ifndef GROUP_H
#define GROUP_H
#include "basicentity.h"
class DATABASELMS_EXPORT Group: public BasicEntity
{
public:
Group();
Group(int id, QString name);
};
#endif // GROUP_H

View File

@@ -0,0 +1,8 @@
#include "instructor.h"
Instructor::Instructor():
User(),
isAdmin()
{
}

18
DataBaseLMS/instructor.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef INSTRUCTOR_H
#define INSTRUCTOR_H
#include "user.h"
class DATABASELMS_EXPORT Instructor: public User
{
public:
Instructor();
void setIsAdmin(bool isAdmin){this->isAdmin = isAdmin;}
bool getIsAdmin(){return isAdmin;}
private:
bool isAdmin;
};
#endif // INSTRUCTOR_H

View File

@@ -0,0 +1,347 @@
#include <QMessageBox>
#include <QCoreApplication>
#include <QSqlError>
#include "interfacedatabaselms.h"
InterfaceDataBaseLMS::InterfaceDataBaseLMS(QWidget* parent):
QWidget(parent),
DataBaseLMS()
{
}
void InterfaceDataBaseLMS::slot_LanguageChanged(QString language)
{
qtLanguageTranslator.load(QString(QStringLiteral("translations/DataBaseLMS_")) + language, QStringLiteral("."));
QCoreApplication::installTranslator(&qtLanguageTranslator);
}
bool InterfaceDataBaseLMS::ConnectionToDB()
{
if(!createConnection())
{
QMessageBox::critical(nullptr, dbName, tr("Connection error: ") + db->lastError().text());
return false;
}
else
{
//QMessageBox::information(nullptr, dbName, tr("Connection is successful!"));
return true;
}
}
bool InterfaceDataBaseLMS::DisConnectionFromDB()
{
deleteConnection();
//QMessageBox::information(nullptr, dbName, tr("Disconnection is successful!"));
return true;
}
bool InterfaceDataBaseLMS::DBisConnected()
{
return isConnected();
}
//Инструкторы
bool InterfaceDataBaseLMS::AuthorizationInstructor(QString login, QString password)
{
if(! transactionBegin())
return false;
if(int id = selectInstructorID(login, password))
{
if(updateInstructorLoggedIn(id, true))
return transactionEnd();
}
transactionEnd();
return false;
}
bool InterfaceDataBaseLMS::deAuthorizationInstructor(QString login)
{
if(! transactionBegin())
return false;
if(int id = selectInstructorID(login))
{
if(updateInstructorLoggedIn(id, false))
return transactionEnd();
}
transactionEnd();
return false;
}
bool InterfaceDataBaseLMS::deAuthorizationAllInstructors()
{
return updateAllInstructorsLoggedIn(false);
}
QString InterfaceDataBaseLMS::getNameInstructorByLogin(QString login)
{
return selectInstructorNameByLogin(login);
}
QList<Instructor> InterfaceDataBaseLMS::getListInstructors()
{
return selectAllInstructors();
}
Instructor InterfaceDataBaseLMS::getInstructor(int id)
{
return selectInstructor(id);
}
int InterfaceDataBaseLMS::newInstructor()
{
return insertInstructor();
}
int InterfaceDataBaseLMS::delInstructor(int id)
{
return deleteInstructor(id);
}
int InterfaceDataBaseLMS::editInstructor(Instructor instructor)
{
//Проверка корректности логина, имени, пароля
QList<Instructor> listInstructors = selectAllInstructors();
for(Instructor exist_instructor : listInstructors)
{
if(instructor.getName() == QStringLiteral("<instructor>"))
{//Имя не корректно!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable instructor name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(instructor.getLogin() == QStringLiteral("<login>"))
{//Логин не корректен!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable instructor login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(instructor.getPassword() == QStringLiteral("<password>"))
{//Пароль не корректный!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable instructor password has been entered.\nThe changes will not be accepted."));
return 0;
}
if(instructor.getName() == exist_instructor.getName() && instructor.getID() != exist_instructor.getID())
{//Имя уже существует
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing instructor name has been entered."));
return 0;
}
if(instructor.getLogin() == exist_instructor.getLogin() && instructor.getID() != exist_instructor.getID())
{//Логин уже существует!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing instructor login has been entered.\nThe changes will not be accepted."));
return 0;
}
}
return updateInstructor(instructor);
}
bool InterfaceDataBaseLMS::isAdminInstructor(int id)
{
return selectInstructorIsAdmin(id);
}
bool InterfaceDataBaseLMS::isArchivedInstructor(int id)
{
return selectInstructorArchived(id);
}
bool InterfaceDataBaseLMS::isLoggedInInstructor(int id)
{
return selectInstructorLoggedIn(id);
}
//Инструкторы
bool InterfaceDataBaseLMS::AuthorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name)
{
if(! transactionBegin())
return false;
if(int id = selectTraineeID(login, password))
{
if(updateTraineeLoggedIn(id, true))
return transactionEnd();
}
transactionEnd();
return false;
}
bool InterfaceDataBaseLMS::deAuthorizationTrainee(QString login)
{
if(! transactionBegin())
return false;
if(int id = selectTraineeID(login))
{
if(updateTraineeLoggedIn(id, false))
return transactionEnd();
}
transactionEnd();
return false;
}
bool InterfaceDataBaseLMS::deAuthorizationAllTrainees()
{
return updateAllTraineesLoggedIn(false);
}
QList<Task> InterfaceDataBaseLMS::getTasksTrainee(int id)
{
return selectTasksOfTrainee(id);
}
QString InterfaceDataBaseLMS::getNameTraineeOnComputer(QString computer_name)
{
return selectTraineeNameOnComputer(computer_name);
}
Trainee InterfaceDataBaseLMS::getTraineeOnComputer(QString computer_name)
{
return selectTraineeOnComputer(computer_name);
}
QString InterfaceDataBaseLMS::getNameTraineeByLogin(QString login)
{
return selectTraineeNameByLogin(login);
}
QList<Trainee> InterfaceDataBaseLMS::getListTraineesInGroup(int id)
{
return selectAllTraineesInGroup(id);
}
QList<Group> InterfaceDataBaseLMS::getListGroups()
{
return selectAllGroups();
}
QList<Trainee> InterfaceDataBaseLMS::getListTrainees()
{
return selectAllTrainees();
}
Trainee InterfaceDataBaseLMS::getTrainee(int id)
{
return selectTrainee(id);
}
Group InterfaceDataBaseLMS::getGroup(int id)
{
return selectGroup(id);
}
int InterfaceDataBaseLMS::newGroup()
{
return insertGroup();
}
int InterfaceDataBaseLMS::delGroup(int id)
{
return deleteGroup(id);
}
int InterfaceDataBaseLMS::editGroup(Group group)
{
//Проверка корректности имени
QList<Group> listGroups = selectAllGroups();
for(Group exist_group : listGroups)
{
if(group.getName() == QStringLiteral("<group>"))
{//Имя не корректно!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable group name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(group.getName() == exist_group.getName() && group.getID() != exist_group.getID())
{//Имя уже существует
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing group name has been entered.\nThe changes will not be accepted."));
return 0;
}
}
return updateGroup(group);
}
int InterfaceDataBaseLMS::newTrainee(int id_group)
{
return insertTrainee(id_group);
}
int InterfaceDataBaseLMS::delTrainee(int id)
{
return deleteTrainee(id);
}
int InterfaceDataBaseLMS::editTrainee(Trainee trainee)
{
//Проверка корректности логина, имени, пароля
QList<Trainee> listTrainees = selectAllTrainees();
for(Trainee exist_trainee : listTrainees)
{
if(trainee.getName() == QStringLiteral("<trainee>"))
{//Имя не корректно!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable trainee name has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getLogin() == QStringLiteral("<login>"))
{//Логин не корректен!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable trainee login has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getPassword() == QStringLiteral("<password>"))
{//Пароль не корректный!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("Unacceptable trainee password has been entered.\nThe changes will not be accepted."));
return 0;
}
if(trainee.getName() == exist_trainee.getName() && trainee.getID() != exist_trainee.getID())
{//Имя уже существует
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing trainee name has been entered."));
return 0;
}
if(trainee.getLogin() == exist_trainee.getLogin() && trainee.getID() != exist_trainee.getID())
{//Логин уже существует!
QMessageBox::critical(nullptr, tr("Editing error!"),
tr("An existing trainee login has been entered.\nThe changes will not be accepted."));
return 0;
}
}
return updateTrainee(trainee);
}
bool InterfaceDataBaseLMS::isArchivedTrainee(int id)
{
return selectTraineeArchived(id);
}
bool InterfaceDataBaseLMS::isLoggedInTrainee(int id)
{
return selectTraineeLoggedIn(id);
}

View File

@@ -0,0 +1,83 @@
#ifndef INTERFACEDATABASELMS_H
#define INTERFACEDATABASELMS_H
#include <QObject>
#include <QWidget>
#include <QTranslator>
#include "DataBaseLMS_global.h"
#include "databaselms.h"
class DATABASELMS_EXPORT InterfaceDataBaseLMS : public /*QObject*/QWidget, DataBaseLMS
{
Q_OBJECT
public:
InterfaceDataBaseLMS(QWidget* parent = nullptr);
public Q_SLOTS:
void slot_LanguageChanged(QString language);
public:
//Соединение
bool ConnectionToDB();
bool DisConnectionFromDB();
bool DBisConnected();
//Инструкторы
bool AuthorizationInstructor(QString login, QString password);
bool deAuthorizationInstructor(QString login);
bool deAuthorizationAllInstructors();
QString getNameInstructorByLogin(QString login);
QList<Instructor> getListInstructors();
Instructor getInstructor(int id);
int newInstructor();
int delInstructor(int id);
int editInstructor(Instructor instructor);
bool isAdminInstructor(int id);
bool isArchivedInstructor(int id);
bool isLoggedInInstructor(int id);
//Обучаемые
bool AuthorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name);
bool deAuthorizationTrainee(QString login);
bool deAuthorizationAllTrainees();
//void setTasks(QString login, QStringList tasks);
QList<Task> getTasksTrainee(int id);
QString getNameTraineeOnComputer(QString computer_name);
Trainee getTraineeOnComputer(QString computer_name);
QString getNameTraineeByLogin(QString login);
QList<Trainee> getListTraineesInGroup(int id);
QList<Group> getListGroups();
QList<Trainee> getListTrainees();
Trainee getTrainee(int id);
Group getGroup(int group_id);
int newGroup();
int delGroup(int id);
int editGroup(Group group);
int newTrainee(int id_group);
int delTrainee(int id);
int editTrainee(Trainee trainee);
bool isArchivedTrainee(int id);
bool isLoggedInTrainee(int id);
private:
QTranslator qtLanguageTranslator;
};
#endif // INTERFACEDATABASELMS_H

7
DataBaseLMS/task.cpp Normal file
View File

@@ -0,0 +1,7 @@
#include "task.h"
Task::Task():
BasicEntity()
{
}

12
DataBaseLMS/task.h Normal file
View File

@@ -0,0 +1,12 @@
#ifndef TASK_H
#define TASK_H
#include "basicentity.h"
class DATABASELMS_EXPORT Task: public BasicEntity
{
public:
Task();
};
#endif // TASK_H

10
DataBaseLMS/trainee.cpp Normal file
View File

@@ -0,0 +1,10 @@
#include "trainee.h"
Trainee::Trainee():
User(),
group(),
computer(),
tasks()
{
}

31
DataBaseLMS/trainee.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef TRAINEE_H
#define TRAINEE_H
#include <QList>
#include "user.h"
#include "group.h"
#include "computer.h"
#include "task.h"
class DATABASELMS_EXPORT Trainee: public User
{
public:
Trainee();
void setGroup(Group group){this->group = group;}
Group getGroup(){return group;}
void setComputer(Computer computer){this->computer = computer;}
Computer getComputer(){return computer;}
void setTasks(QList<Task> tasks){this->tasks = tasks;}
QList<Task> getTasks(){return tasks;}
private:
Group group;
Computer computer;
QList<Task> tasks;
};
#endif // TRAINEE_H

Binary file not shown.

View File

@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru_RU">
<context>
<name>InterfaceDataBaseLMS</name>
<message>
<location filename="../interfacedatabaselms.cpp" line="23"/>
<source>Connection error: </source>
<translation>Ошибка соединения: </translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="28"/>
<source>Connection is successful!</source>
<translation>Соединение успешно!</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="36"/>
<source>Disconnection is successful!</source>
<translation>Отключение успешно!</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="109"/>
<location filename="../interfacedatabaselms.cpp" line="116"/>
<location filename="../interfacedatabaselms.cpp" line="123"/>
<location filename="../interfacedatabaselms.cpp" line="130"/>
<location filename="../interfacedatabaselms.cpp" line="137"/>
<location filename="../interfacedatabaselms.cpp" line="252"/>
<location filename="../interfacedatabaselms.cpp" line="259"/>
<location filename="../interfacedatabaselms.cpp" line="286"/>
<location filename="../interfacedatabaselms.cpp" line="293"/>
<location filename="../interfacedatabaselms.cpp" line="300"/>
<location filename="../interfacedatabaselms.cpp" line="307"/>
<location filename="../interfacedatabaselms.cpp" line="314"/>
<source>Editing error!</source>
<translation>Ошибка редактирования!</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="110"/>
<source>Unacceptable instructor name has been entered.
The changes will not be accepted.</source>
<translation>Введено недопустимое имя инструктора.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="117"/>
<source>Unacceptable instructor login has been entered.
The changes will not be accepted.</source>
<translation>Введен недопустимый логин инструктора.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="124"/>
<source>Unacceptable instructor password has been entered.
The changes will not be accepted.</source>
<translation>Введен недопустимый пароль инструктора.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="131"/>
<source>An existing instructor name has been entered.</source>
<translation>Введено существующее имя инструктора.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="138"/>
<source>An existing instructor login has been entered.
The changes will not be accepted.</source>
<translation>Введен существующий логин инструктора.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="253"/>
<source>Unacceptable group name has been entered.
The changes will not be accepted.</source>
<translation>Введено недопустимое имя группы.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="260"/>
<source>An existing group name has been entered.
The changes will not be accepted.</source>
<translation>Введено существующее имя группы.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="287"/>
<source>Unacceptable trainee name has been entered.
The changes will not be accepted.</source>
<translation>Введено недопустимое имя обучаемого.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="294"/>
<source>Unacceptable trainee login has been entered.
The changes will not be accepted.</source>
<translation>Введен недопустимый логин обучаемого.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="301"/>
<source>Unacceptable trainee password has been entered.
The changes will not be accepted.</source>
<translation>Введен недопустимый пароль обучаемого.
Изменения не будут приняты.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="308"/>
<source>An existing trainee name has been entered.</source>
<translation>Введено существующее имя обучаемого.</translation>
</message>
<message>
<location filename="../interfacedatabaselms.cpp" line="315"/>
<source>An existing trainee login has been entered.
The changes will not be accepted.</source>
<translation>Введен существующий логин обучаемого.
Изменения не будут приняты.</translation>
</message>
</context>
</TS>

11
DataBaseLMS/user.cpp Normal file
View File

@@ -0,0 +1,11 @@
#include "user.h"
User::User():
BasicEntity(),
login(),
password(),
archived(),
loggedIn()
{
}

30
DataBaseLMS/user.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef USER_H
#define USER_H
#include "basicentity.h"
class User: public BasicEntity
{
public:
User();
void setLogin(QString login){this->login = login;}
QString getLogin(){return login;}
void setPassword(QString password){this->password = password;}
QString getPassword(){return password;}
void setArchived(bool archived){this->archived = archived;}
bool getArchived(){return archived;}
void setLoggedIn(bool loggedIn){this->loggedIn = loggedIn;}
bool getLoggedIn(){return loggedIn;}
private:
QString login;
QString password;
bool archived;
bool loggedIn;
};
#endif // USER_H