PSQL 30.10.2024

This commit is contained in:
krivoshein
2024-10-30 15:33:26 +03:00
commit 024cd38bd6
256 changed files with 31332 additions and 0 deletions

View File

@@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.5)
project(InstructorsAndTrainees LANGUAGES CXX)
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 Xml REQUIRED)
find_package(Qt5 COMPONENTS Sql REQUIRED)
find_package(Qt5 COMPONENTS LinguistTools REQUIRED)
add_library(InstructorsAndTrainees SHARED
instructorsAndTrainees_global.h
instructorsAndTrainees.cpp
instructorsAndTrainees.h
commonview.cpp
commonview.h
trainees/editortrainees.cpp
trainees/editortrainees.h
trainees/editortrainees.ui
trainees/dialogeditgroup.cpp
trainees/dialogeditgroup.h
trainees/dialogeditgroup.ui
trainees/dialogedittrainee.cpp
trainees/dialogedittrainee.h
trainees/dialogedittrainee.ui
trainees/computersLocations.h
trainees/computersLocations.cpp
trainees/databasetrainees.h
trainees/databasetrainees.cpp
trainees/viewertrainees.cpp
trainees/viewertrainees.h
trainees/viewertrainees.ui
trainees/traineesview.cpp
trainees/traineesview.h
instructors/viewerinstructors.cpp
instructors/viewerinstructors.h
instructors/viewerinstructors.ui
instructors/databaseinstructors.cpp
instructors/databaseinstructors.h
instructors/editorinstructors.cpp
instructors/editorinstructors.h
instructors/editorinstructors.ui
instructors/dialogeditinstructor.cpp
instructors/dialogeditinstructor.h
instructors/dialogeditinstructor.ui
instructors/dialogauthorizationinstructor.cpp
instructors/dialogauthorizationinstructor.h
instructors/dialogauthorizationinstructor.ui
instructors/instructorsview.cpp
instructors/instructorsview.h
tasks/taskswidget.cpp
tasks/taskswidget.h
tasks/taskswidget.ui
resources.qrc
)
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/instructors)
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/trainees)
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tasks)
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Widgets)
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Xml)
target_link_libraries(InstructorsAndTrainees PRIVATE Qt5::Sql)
target_compile_definitions(InstructorsAndTrainees PRIVATE INSTRUCTORSANDTRAINEES_LIBRARY)
target_include_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB/DataBaseLMS)
if(PROJECT_TYPE_DEBUG)
target_link_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB/Debug64)
elseif()
target_link_directories(InstructorsAndTrainees PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../DB/Release64)
endif()
target_link_libraries(InstructorsAndTrainees PRIVATE libDataBaseLMS.dll)
#install(TARGETS InstructorsAndTrainees DESTINATION ${VEYON_LIB_DIR})

View File

@@ -0,0 +1,618 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2024-10-30T15:31:27. -->
<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:/LMS/DBXML/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/DBXML/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:/VEYON/SUO/build-InstructorsAndTrainees-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:/VEYON/SUO/build-InstructorsAndTrainees-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.Target.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.14.2 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.14.2 MinGW 32-bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5142.win32_mingw73_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</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:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_32_bit-Debug</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:/VEYON/SUO/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:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_32_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:/VEYON/SUO/build-InstructorsAndTrainees-Desktop_Qt_5_14_2_MinGW_32_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">2</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,319 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 6.0.2, 2024-05-27T09:37:39. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{88628a15-8b1c-4544-92e6-5683c5f27136}</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.PreferSingleLineComments">false</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="bool" key="EditorConfiguration.UseIndenter">false</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="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.BuildSystem</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">8</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{ec5f7042-f1c7-4b2e-9c22-2340fe1a69bd}</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">
<value type="QString" key="CMake.Build.Type">Debug</value>
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<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.DisplayName">Сборка</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">
<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.DisplayName">Сборка</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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">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">
<value type="QString" key="CMake.Build.Type">Release</value>
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/build-InstructorsAndTrainees-Desktop-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<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">
<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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">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">
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/build-InstructorsAndTrainees-Desktop-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<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">
<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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<value type="QString" key="CMake.Build.Type">MinSizeRel</value>
<value type="QString" key="CMake.Initial.Parameters">-GUnix Makefiles
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel
-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake
-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/andrey/VEYON/SUO/build-InstructorsAndTrainees-Desktop-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<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">
<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.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</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>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</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.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</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,3 @@
<?xml version='1.0' encoding='utf-8'?>
<groupsTrainees>
</groupsTrainees>

View File

@@ -0,0 +1,3 @@
<?xml version='1.0' encoding='utf-8'?>
<allInstructors>
</allInstructors>

View File

@@ -0,0 +1,36 @@
#include "commonview.h"
CommonView::CommonView(TypeView type, QWidget *parent):
QWidget(parent),
treeWidget(nullptr),
typeView(type),
archiveVisible(false),
notLoggedInVisible(false)
{
}
void CommonView::setItemColorArchive(QTreeWidgetItem *item)
{
int columnCount = treeWidget->columnCount();
for (int i = 0; i < columnCount; i++)
item->setBackground(i, QBrush(QColor(220, 220, 220)));
}
void CommonView::setItemColorNoArchive(QTreeWidgetItem *item)
{
int columnCount = treeWidget->columnCount();
for (int i = 0; i < columnCount; i++)
item->setBackground(i, QBrush(QColor(255, 255, 255)));
}
void CommonView::setItemColor(QTreeWidgetItem *item, QColor color)
{
int columnCount = treeWidget->columnCount();
for (int i = 0; i < columnCount; i++)
item->setBackground(i, color);
}

View File

@@ -0,0 +1,49 @@
#ifndef COMMONVIEW_H
#define COMMONVIEW_H
#include <QTreeWidget>
#include <QTranslator>
#include "instructorsAndTrainees_global.h"
//Родительский класс представления БД Инструкторов/Обучаемых (самого верхнего уровня)
class INSTRUCTORSANDTRAINEES_EXPORT CommonView : public QWidget
{
Q_OBJECT
public:
enum TypeView
{
onlyView,
control
};
public:
CommonView(TypeView type, QWidget *parent = nullptr);
protected:
void setArchiveVisible(bool archiveVisible)
{
this->archiveVisible = archiveVisible;
}
void setNotLoggedInVisible(bool notLoggedInVisible)
{
this->notLoggedInVisible = notLoggedInVisible;
}
void setItemColorArchive(QTreeWidgetItem* item);
void setItemColorNoArchive(QTreeWidgetItem* item);
void setItemColor(QTreeWidgetItem* item, QColor color);
protected:
QTreeWidget* treeWidget;
TypeView typeView;
bool archiveVisible;
bool notLoggedInVisible;
protected:
QTranslator qtLanguageTranslator;
};
#endif // COMMONVIEW_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,346 @@
#include <QDomDocument>
#include <QFile>
#include <QDebug>
#include <QMessageBox>
#include "databaseinstructors.h"
DataBaseInstructors::DataBaseInstructors(QString appPath, DataBaseLMS* dbLMS)
{
appDirPath = appPath;
this->dbLMS = dbLMS;
if(this->dbLMS != nullptr)
LoadInstructorsPSQL();
else
LoadInstructorsXML();
}
DataBaseInstructors::~DataBaseInstructors()
{
if(dbLMS == nullptr)
SaveInstructorsXML();
}
void DataBaseInstructors::LoadInstructorsXML()
{
QDomDocument instructorsDOM;
QString xmlFileName = appDirPath + QStringLiteral("/DBXML/instructors.xml");
QFile xmlInFile(xmlFileName);
if (!xmlInFile.open(QFile::ReadOnly | QFile::Text))
{
QMessageBox::critical(nullptr, tr("Attention!"), tr("The file could not be opened ") + xmlFileName);
qDebug() << QStringLiteral("LoadInstructorsXML: Не удалось открыть файл ") + xmlFileName;
return;
}
else
{
listOfInstructors.clear();
instructorsDOM.setContent(xmlInFile.readAll());
xmlInFile.close();
QDomNode allInstructorsNode = instructorsDOM.namedItem(QStringLiteral("allInstructors"));
for(int i = 0; i < allInstructorsNode.childNodes().count(); i++)
{
QDomNode instructorNode = allInstructorsNode.childNodes().at(i);
if(instructorNode.nodeName().toLower() == QStringLiteral("instructor"))
{//Инструктор
Instructor instructor;
instructor.setName(instructorNode.toElement().attribute(QStringLiteral("name")));
instructor.setLogin(instructorNode.toElement().attribute(QStringLiteral("login")));
instructor.setPassword(instructorNode.toElement().attribute(QStringLiteral("password")));
instructor.setIsAdmin(instructorNode.toElement().attribute(QStringLiteral("isAdmin")) == QStringLiteral("да") ? true : false);
instructor.setArchived(instructorNode.toElement().attribute(QStringLiteral("archived")) == QStringLiteral("да") ? true : false);
instructor.setLoggedIn(false);
listOfInstructors.append(instructor);
}
}//for(int i = 0; i < allInstructorsNode.childNodes().count(); i++)
}//else
}
void DataBaseInstructors::SaveInstructorsXML()
{
QDomDocument instructorsDOM;
QFile blankFile(QStringLiteral(":/blankXML/instructors.xml"));
if (! blankFile.open(QFile::ReadOnly | QFile::Text))
{
QMessageBox::critical(nullptr, tr("Attention!"), tr("The file could not be read :/blankXML/instructors.xml"));
qDebug() << "SaveInstructorsXML: Не удалось считать файл :/blankXML/instructors.xml";
return;
}
instructorsDOM.setContent(blankFile.readAll());
blankFile.close();
QDomNode allInstructorsNode = instructorsDOM.namedItem(QStringLiteral("allInstructors"));
//Инструкторы
for(Instructor instructor : listOfInstructors)
{
QDomNode instructorNode = instructorsDOM.createElement(QStringLiteral("instructor"));
allInstructorsNode.appendChild(instructorNode);
instructorNode.toElement().setAttribute(QStringLiteral("name"), instructor.getName());
instructorNode.toElement().setAttribute(QStringLiteral("login"), instructor.getLogin());
instructorNode.toElement().setAttribute(QStringLiteral("password"), instructor.getPassword());
instructorNode.toElement().setAttribute(QStringLiteral("isAdmin"), instructor.getIsAdmin() ? QStringLiteral("да") : QStringLiteral("нет"));
instructorNode.toElement().setAttribute(QStringLiteral("archived"), instructor.getArchived() ? QStringLiteral("да") : QStringLiteral("нет"));
}
QString xmlFileName = appDirPath + QStringLiteral("/DBXML/instructors.xml");
QFile xmlOutFile(xmlFileName);
if (!xmlOutFile.open(QFile::WriteOnly | QFile::Text))
{
QMessageBox::critical(nullptr, tr("Attention!"), tr("Failed to write the file ") + xmlFileName);
qDebug() << QStringLiteral("SaveInstructorsXML: Не удалось записать файл ") + xmlFileName;
return;
}
QTextStream outFile(&xmlOutFile);
instructorsDOM.save(outFile, 4);
xmlOutFile.close();
}
void DataBaseInstructors::LoadInstructorsPSQL()
{
listOfInstructors.clear();
listOfInstructors = dbLMS->selectAllInstructors();
}
bool DataBaseInstructors::AuthorizationInstructor(QString login, QString password)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getArchived())
continue;
if(listOfInstructors[i].getLogin() == login && listOfInstructors[i].getPassword() == password)
{
listOfInstructors[i].setLoggedIn(true);
return true;
}
}
return false;
}
bool DataBaseInstructors::deAuthorizationInstructor(QString login)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
//if(listOfInstructors[i].getArchived())
//continue;
if(listOfInstructors[i].getLogin() == login)
{
listOfInstructors[i].setLoggedIn(false);
return true;
}
}
return false;
}
Instructor DataBaseInstructors::getInstructor(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
return listOfInstructors[i];
}
return Instructor();
}
QString DataBaseInstructors::getNameInstructorByLogin(QString login)
{
for(Instructor instructor : listOfInstructors)
{
if(instructor.getLogin() == login)
return instructor.getName();
}
return QString(QStringLiteral(""));
}
QString DataBaseInstructors::getAuthorizedInstructorName()
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getLoggedIn())
return listOfInstructors[i].getName();
}
return QStringLiteral("");
}
QString DataBaseInstructors::newInstructor()
{
Instructor instructor;
instructor.setName(generateDefaultNameInstructor());
instructor.setLogin(generateDefaultLoginInstructor());
instructor.setPassword(QStringLiteral("<password>"));
instructor.setIsAdmin(false);
instructor.setArchived(false);
instructor.setLoggedIn(false);
bool result = dbLMS->insertInstructor(instructor);
if(result)
{
listOfInstructors.append(instructor);
return instructor.getName();
}
else
return QStringLiteral("");
}
void DataBaseInstructors::deleteInstructor(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
{
int id = listOfInstructors[i].getID();
bool result = dbLMS->deleteInstructor(id);
if(result)
listOfInstructors.removeAt(i);
return;
}
}
}
void DataBaseInstructors::toArchiveInstructor(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
if(! listOfInstructors[i].getArchived())
{
Instructor instructor = listOfInstructors[i];
instructor.setArchived(true);
bool result = dbLMS->updateInstructor(instructor);
if(result)
listOfInstructors[i].setArchived(true);
}
}
}
void DataBaseInstructors::fromeArchiveInstructor(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
if(listOfInstructors[i].getArchived())
{
Instructor instructor = listOfInstructors[i];
instructor.setArchived(false);
bool result = dbLMS->updateInstructor(instructor);
if(result)
listOfInstructors[i].setArchived(false);
}
}
}
bool DataBaseInstructors::editInstructor(QString name, Instructor instructor)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
{
if( (!checkExistNameInstructor(instructor.getName()) || instructor.getName() == name) &&
(!checkExistLoginInstructor(instructor.getLogin()) || instructor.getLogin() == listOfInstructors[i].getLogin()) )
{
instructor.setID(listOfInstructors[i].getID());
bool result = dbLMS->updateInstructor(instructor);
if(result)
{
listOfInstructors.replace(i, instructor);
return true;
}
else
return false;
}
}
}
return false;
}
bool DataBaseInstructors::isAdmin(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
return listOfInstructors[i].getIsAdmin();
}
return false;
}
bool DataBaseInstructors::isArchived(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
return listOfInstructors[i].getArchived();
}
return false;
}
QString DataBaseInstructors::generateDefaultNameInstructor()
{
int numInstructor = 0;
QString name;
do
{
name = QStringLiteral("<") + tr("Instructor") + QStringLiteral(" ") + QString::number(++numInstructor) + QStringLiteral(">");
}while(checkExistNameInstructor(name));
return name;
}
bool DataBaseInstructors::checkExistNameInstructor(QString name)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getName() == name)
return true;
}
return false;
}
QString DataBaseInstructors::generateDefaultLoginInstructor()
{
int numInstructor = 0;
QString login;
do
{
login = QStringLiteral("<I") + QString::number(++numInstructor) + QStringLiteral(">");
}while(checkExistLoginInstructor(login));
return login;
}
bool DataBaseInstructors::checkExistLoginInstructor(QString login)
{
//Инструкторы
for(int i = 0; i < listOfInstructors.count(); i++)
{
if(listOfInstructors[i].getLogin() == login)
return true;
}
return false;
}

View File

@@ -0,0 +1,61 @@
#ifndef DATABASEINSTRUCTORS_H
#define DATABASEINSTRUCTORS_H
#include <QList>
#include <QObject>
#include "instructorsAndTrainees_global.h"
#include "instructor.h"
#include "databaselms.h"
class INSTRUCTORSANDTRAINEES_EXPORT DataBaseInstructors : QObject
{
Q_OBJECT
public:
DataBaseInstructors(QString appPath, DataBaseLMS* dbLMS = nullptr);
~DataBaseInstructors();
void LoadInstructorsXML();
void SaveInstructorsXML();
void LoadInstructorsPSQL();
bool AuthorizationInstructor(QString login, QString password);
bool deAuthorizationInstructor(QString login);
QList<Instructor> getListInstructors(){ return listOfInstructors; } //Для загрузки
Instructor getInstructor(QString name);
QString getNameInstructorByLogin(QString login);
QString getAuthorizedInstructorName();
QString newInstructor();
void deleteInstructor(QString name);
void toArchiveInstructor(QString name);
void fromeArchiveInstructor(QString name);
bool editInstructor(QString name, Instructor instructor);
bool isAdmin(QString name);
bool isArchived(QString name);
private:
QString generateDefaultNameInstructor();
bool checkExistNameInstructor(QString name);
QString generateDefaultLoginInstructor();
bool checkExistLoginInstructor(QString login);
private:
QList<Instructor> listOfInstructors;
QString appDirPath;
DataBaseLMS* dbLMS;
};
#endif // DATABASEINSTRUCTORS_H

View File

@@ -0,0 +1,14 @@
#include "dialogauthorizationinstructor.h"
#include "ui_dialogauthorizationinstructor.h"
DialogAuthorizationInstructor::DialogAuthorizationInstructor(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogAuthorizationInstructor)
{
ui->setupUi(this);
}
DialogAuthorizationInstructor::~DialogAuthorizationInstructor()
{
delete ui;
}

View File

@@ -0,0 +1,33 @@
#ifndef DIALOGAUTHORIZATIONINSTRUCTOR_H
#define DIALOGAUTHORIZATIONINSTRUCTOR_H
#include <QDialog>
#include "ui_dialogauthorizationinstructor.h"
namespace Ui {
class DialogAuthorizationInstructor;
}
class DialogAuthorizationInstructor : public QDialog
{
Q_OBJECT
public:
explicit DialogAuthorizationInstructor(QWidget *parent = nullptr);
~DialogAuthorizationInstructor();
QString getLogin()
{
return ui->editLogin->text();
}
QString getPassword()
{
return ui->editPassword->text();
}
private:
Ui::DialogAuthorizationInstructor *ui;
};
#endif // DIALOGAUTHORIZATIONINSTRUCTOR_H

View File

@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogAuthorizationInstructor</class>
<widget class="QDialog" name="DialogAuthorizationInstructor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>140</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="windowTitle">
<string>Instructor authorization</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Login</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editLogin">
<property name="text">
<string>admin</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editPassword">
<property name="text">
<string>admin</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogAuthorizationInstructor</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogAuthorizationInstructor</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,42 @@
#include "dialogeditinstructor.h"
#include "ui_dialogeditinstructor.h"
DialogEditInstructor::DialogEditInstructor(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogEditInstructor)
{
ui->setupUi(this);
}
DialogEditInstructor::~DialogEditInstructor()
{
delete ui;
}
void DialogEditInstructor::setInstructor(Instructor instructor)
{
ui->editName ->setText(instructor.getName());
ui->editLogin->setText(instructor.getLogin());
ui->editPassword->setText(instructor.getPassword());
ui->checkIsAdmin->setChecked(instructor.getIsAdmin());
ui->checkArchived->setChecked(instructor.getArchived());
ui->checkLoggedIn->setChecked(instructor.getLoggedIn());
if(instructor.getIsAdmin())
ui->editName->setEnabled(false);
else
ui->editName->setEnabled(true);
}
Instructor DialogEditInstructor::getInstructor()
{
Instructor instructor;
instructor.setName(ui->editName->text());
instructor.setLogin(ui->editLogin->text());
instructor.setPassword(ui->editPassword->text());
instructor.setIsAdmin(ui->checkIsAdmin->isChecked());
instructor.setArchived(ui->checkArchived->isChecked());
instructor.setLoggedIn(ui->checkLoggedIn->isChecked());
return instructor;
}

View File

@@ -0,0 +1,27 @@
#ifndef DIALOGEDITINSTRUCTOR_H
#define DIALOGEDITINSTRUCTOR_H
#include <QDialog>
#include "instructor.h"
#include "ui_dialogeditinstructor.h"
namespace Ui {
class DialogEditInstructor;
}
class DialogEditInstructor : public QDialog
{
Q_OBJECT
public:
explicit DialogEditInstructor(QWidget *parent = nullptr);
~DialogEditInstructor();
void setInstructor(Instructor instructor);
Instructor getInstructor();
private:
Ui::DialogEditInstructor *ui;
};
#endif // DIALOGEDITINSTRUCTOR_H

View File

@@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogEditInstructor</class>
<widget class="QDialog" name="DialogEditInstructor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>286</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="windowTitle">
<string>Instructor</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editName">
<property name="enabled">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Login</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editLogin"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editPassword"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="checkIsAdmin">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Administrator</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/admin.png</normaloff>
<disabledoff>:/icons/admin.png</disabledoff>:/icons/admin.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="checkArchived">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Archived</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/archive.png</normaloff>
<disabledoff>:/icons/archive.png</disabledoff>:/icons/archive.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="checkLoggedIn">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Logged</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/circleGreen.png</normaloff>
<disabledoff>:/icons/circleGreen.png</disabledoff>:/icons/circleGreen.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogEditInstructor</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogEditInstructor</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,189 @@
#include <QMessageBox>
#include "editorinstructors.h"
#include "dialogeditinstructor.h"
#include "ui_editorinstructors.h"
EditorInstructors::EditorInstructors(DataBaseInstructors* db, QWidget *parent) :
//QDialog(parent),
InstructorsView(db, CommonView::TypeView::control, parent),
ui(new Ui::EditorInstructors)
{
ui->setupUi((QDialog*)this);
preparationTreeWidget(ui->treeWidget);
setNotLoggedInVisible(true);
loadInstructorsFromDB();
}
EditorInstructors::~EditorInstructors()
{
delete ui;
}
void EditorInstructors::on_btnNewInstructor_clicked()
{
QString name = dbInstructors->newInstructor();
loadInstructorsFromDB();
setCurrentInstructor(name);
}
void EditorInstructors::on_btnDeleteInstructor_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent != nullptr)
{
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбран Инструктор
QString name = treeItemCurrent->text(0);
if(dbInstructors->isAdmin(name))
{//Это Админ!
QMessageBox::critical(this, tr("Error!"), tr("You cannot delete the Administrator."));
return;
}
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete it anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
dbInstructors->deleteInstructor(name);
loadInstructorsFromDB();
}
}
}
}
void EditorInstructors::on_btnToOrFromArchive_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent != nullptr)
{
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбран Инструктор
QString name = treeItemCurrent->text(0);
if(dbInstructors->isArchived(name))
{//Архивный
dbInstructors->fromeArchiveInstructor(name);
loadInstructorsFromDB();
setCurrentInstructor(name);
}
else
{//Не Архивный
dbInstructors->toArchiveInstructor(name);
loadInstructorsFromDB();
if(archiveVisible)
setCurrentInstructor(name);
}
}
}
}
void EditorInstructors::on_btnEdit_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent == nullptr)
return;
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбран Инструктор
QString name = treeItemCurrent->text(0);
DialogEditInstructor dlg(this);
dlg.setInstructor(dbInstructors->getInstructor(name));
switch( dlg.exec() )
{
case QDialog::Accepted:
{
if(dbInstructors->editInstructor(name, dlg.getInstructor()))
{
loadInstructorsFromDB();
setCurrentInstructor(dlg.getInstructor().getName());
}
else
QMessageBox::critical(this, tr("Editing error!"),
tr("An existing instructor name or login has been entered.\nThe changes will not be accepted."));
break;
}
case QDialog::Rejected:
break;
default:
break;
}
}
}
void EditorInstructors::on_btnArchive_clicked()
{
bool state = ui->btnArchive->isChecked();
setArchiveVisible(state);
loadInstructorsFromDB();
}
void EditorInstructors::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
{
//Определяем доступность и функционал кнопок для выбранного элемента
if(current == nullptr)
return;
QTreeWidgetItem *treeItemParent = current->parent();
if(treeItemParent == nullptr)
{//Выбран инструктор
QString name = current->text(0);
if(dbInstructors->isArchived(name))
{//Архивный
ui->btnToOrFromArchive->setText(tr("From archive"));
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/icons/instructorFromArchive.png")));
}
else
{//Не Архивный
ui->btnToOrFromArchive->setText(tr("To archive"));
ui->btnToOrFromArchive->setIcon(QIcon(QStringLiteral(":/icons/instructorArchive.png")));
}
ui->btnNewInstructor->setEnabled(true);
if(dbInstructors->isAdmin(name))
{//Это Админ! Удалять/Архивировать нельзя!
ui->btnDeleteInstructor->setEnabled(false);
ui->btnToOrFromArchive->setEnabled(false);
}
else
{
ui->btnToOrFromArchive->setEnabled(true);
if(dbInstructors->isArchived(name))
ui->btnDeleteInstructor->setEnabled(true);
else
ui->btnDeleteInstructor->setEnabled(false);
}
ui->btnEdit->setEnabled(true);
ui->btnArchive->setEnabled(true);
}
}
void EditorInstructors::setCurrentInstructor(QString name)
{
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
if(item != nullptr)
if(item->text(0) == name)
{
treeWidget->setCurrentItem(item);
break;
}
}
}

View File

@@ -0,0 +1,38 @@
#ifndef DIALOGINSTRUCTORS_H
#define DIALOGINSTRUCTORS_H
#include <QDialog>
#include <QTreeWidget>
#include "databaseinstructors.h"
#include "instructorsview.h"
namespace Ui {
class EditorInstructors;
}
//Диалог для просмотра и управления БД Инструкторов
class EditorInstructors : /*public QDialog,*/ public InstructorsView
{
Q_OBJECT
public:
explicit EditorInstructors(DataBaseInstructors* db, QWidget *parent = nullptr);
~EditorInstructors();
private Q_SLOTS:
void on_btnNewInstructor_clicked();
void on_btnDeleteInstructor_clicked();
void on_btnToOrFromArchive_clicked();
void on_btnEdit_clicked();
void on_btnArchive_clicked();
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
private:
void setCurrentInstructor(QString name);
private:
Ui::EditorInstructors *ui;
};
#endif // DIALOGINSTRUCTORS_H

View File

@@ -0,0 +1,299 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditorInstructors</class>
<widget class="QDialog" name="EditorInstructors">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1300</width>
<height>800</height>
</rect>
</property>
<property name="windowTitle">
<string>List instructors</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QWidget" name="widget" native="true">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(240, 240, 240);</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<widget class="QTreeWidget" name="treeWidget">
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="columnCount">
<number>1</number>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>127</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(180, 180, 180);</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QToolButton" name="btnNewInstructor">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>160</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>New instructor</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/addInstructor.png</normaloff>:/icons/addInstructor.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnDeleteInstructor">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>160</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Delete instructor</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/deleteInstructor.png</normaloff>:/icons/deleteInstructor.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnToOrFromArchive">
<property name="minimumSize">
<size>
<width>160</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>To archive</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/instructorArchive.png</normaloff>:/icons/instructorArchive.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>160</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Edit</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/edit.png</normaloff>:/icons/edit.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="btnArchive">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>160</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Show archive</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/archive.png</normaloff>:/icons/archive.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,125 @@
#include <QHeaderView>
#include <QTranslator>
#include "instructorsview.h"
InstructorsView::InstructorsView(DataBaseInstructors* db, TypeView type, QWidget *parent):
CommonView(type, parent),
dbInstructors(db)
{
}
void InstructorsView::preparationTreeWidget(QTreeWidget* tree)
{
treeWidget = tree;
if(treeWidget == nullptr)
return;
treeWidget->setColumnCount(6);
reSetHeadTreeWidget();
treeWidget->header()->setStyleSheet(QStringLiteral("font-size: 12pt;"));
treeWidget->setColumnWidth(0, 200);
treeWidget->setColumnWidth(1, 130);
treeWidget->setColumnWidth(2, 130);
treeWidget->setColumnWidth(3, 130);
treeWidget->setColumnWidth(4, 130);
treeWidget->setColumnWidth(5, 130);
if(typeView == TypeView::onlyView)
{//onlyView
treeWidget->setColumnHidden(1, true);
treeWidget->setColumnHidden(2, true);
treeWidget->setColumnHidden(4, true);
}
else
{//control
treeWidget->setColumnHidden(4, true);
}
}
void InstructorsView::loadInstructorsFromDB()
{
if(treeWidget == nullptr)
return;
//Обновление дерева
treeWidget->clear();
//Инструкторы
QList<Instructor> listInstructors;
listInstructors = dbInstructors->getListInstructors();
for(Instructor instructor : listInstructors)
{
QTreeWidgetItem *ItemInstructor = new QTreeWidgetItem(treeWidget);
ItemInstructor->setText(0, instructor.getName());
ItemInstructor->setText(1, instructor.getLogin());
ItemInstructor->setText(2, instructor.getPassword());
if(instructor.getArchived())
{//Архивный
ItemInstructor->setText(4, tr("yes"));
ItemInstructor->setIcon(0, QIcon(QStringLiteral(":/icons/instructorArchive.png")));
setItemColorArchive(ItemInstructor);
}
else
{//Не Архивный
ItemInstructor->setText(4, tr("no"));
ItemInstructor->setIcon(0, QIcon(QStringLiteral(":/icons/instructor.png")));
setItemColorNoArchive(ItemInstructor);
}
if(instructor.getIsAdmin())
{//Админ
ItemInstructor->setText(3, tr("yes"));
ItemInstructor->setIcon(0, QIcon(QStringLiteral(":/icons/admin.png")));
}
else
{//Не Админ
ItemInstructor->setText(3, tr("no"));
}
if(instructor.getLoggedIn())
{//Залогинен
ItemInstructor->setText(5, tr("yes"));
ItemInstructor->setIcon(5, QIcon(QStringLiteral(":/icons/circleGreen.png")));
}
else
{//Не Залогинен
ItemInstructor->setText(5, tr("no"));
ItemInstructor->setIcon(5, QIcon(QStringLiteral(":/icons/circleGray.png")));
}
//Скрываем архивных (при необходимости)
if(instructor.getArchived())
if(!archiveVisible)
ItemInstructor->setHidden(true);
//Скрываем незалогиненых (при необходимости)
if(! instructor.getLoggedIn())
if(! notLoggedInVisible)
ItemInstructor->setHidden(true);
}
treeWidget->setSortingEnabled(true);
treeWidget->sortItems(0, Qt::SortOrder::AscendingOrder);
treeWidget->expandAll();
if(typeView == TypeView::control)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
if(item != nullptr)
treeWidget->setCurrentItem(item);
}
}
void InstructorsView::reSetHeadTreeWidget()
{
QStringList listHeaders = {tr("Instructor"), tr("Login"), tr("Password"), tr("Administrator"), tr("Archived"), tr("Logged")};
treeWidget->setHeaderLabels(listHeaders);
}

View File

@@ -0,0 +1,27 @@
#ifndef INSTRUCTORSVIEW_H
#define INSTRUCTORSVIEW_H
#include "instructorsAndTrainees_global.h"
#include "databaseinstructors.h"
#include "commonview.h"
//Родительский класс представления БД Инструкторов (для просмотра и управления)
class INSTRUCTORSANDTRAINEES_EXPORT InstructorsView: public CommonView
{
Q_OBJECT
public:
InstructorsView(DataBaseInstructors* db, TypeView type, QWidget *parent = nullptr);
protected:
void preparationTreeWidget(QTreeWidget* tree);
void loadInstructorsFromDB();
void reSetHeadTreeWidget();
protected:
DataBaseInstructors* dbInstructors;
};
#endif // INSTRUCTORSVIEW_H

View File

@@ -0,0 +1,47 @@
#include "viewerinstructors.h"
#include "ui_viewerinstructors.h"
ViewerInstructors::ViewerInstructors(DataBaseInstructors* db, QWidget *parent) :
//QWidget(parent),
InstructorsView(db, CommonView::TypeView::onlyView, parent),
ui(new Ui::ViewerInstructors)
{
ui->setupUi(this);
// Сделаем первоначальную инициализацию перевода для окна виджета
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + QString(QStringLiteral("ru_RU")), QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
preparationTreeWidget(ui->treeWidget);
setNotLoggedInVisible(true);
loadInstructorsFromDB();
}
ViewerInstructors::~ViewerInstructors()
{
delete ui;
}
void ViewerInstructors::setFilterInstructorLoggedIn(bool enabled)
{
setNotLoggedInVisible(!enabled);
loadInstructorsFromDB();
}
void ViewerInstructors::changeEvent(QEvent *event)
{
// В случае получения события изменения языка приложения
if (event->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this); // переведём окно заново
reSetHeadTreeWidget();
loadInstructorsFromDB();
}
}
void ViewerInstructors::slot_LanguageChanged(QString language)
{
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + language, QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
}

View File

@@ -0,0 +1,44 @@
#ifndef INSTRUCTORSWIDGET_H
#define INSTRUCTORSWIDGET_H
#include <QWidget>
#include "instructorsAndTrainees_global.h"
#include "databaseinstructors.h"
#include "instructorsview.h"
namespace Ui {
class ViewerInstructors;
}
//Виджет только для просмотра БД Инструкторов
class INSTRUCTORSANDTRAINEES_EXPORT ViewerInstructors : /*public QWidget,*/ public InstructorsView
{
Q_OBJECT
public:
explicit ViewerInstructors(DataBaseInstructors* db, QWidget *parent = nullptr);
~ViewerInstructors();
protected:
// Метод получения событий
// В нём будет производиться проверка события смены перевода приложения
void changeEvent(QEvent * event) override;
public Q_SLOTS:
void slot_LanguageChanged(QString language);
public:
void updateInstructors()
{
loadInstructorsFromDB();
}
void setFilterInstructorLoggedIn( bool enabled );
private:
Ui::ViewerInstructors *ui;
};
#endif // INSTRUCTORSWIDGET_H

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ViewerInstructors</class>
<widget class="QWidget" name="ViewerInstructors">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="windowTitle">
<string>Instructors</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,107 @@
#include <QDebug>
#include <QTranslator>
#include "instructorsAndTrainees.h"
#include "editortrainees.h"
#include "editorinstructors.h"
#include "dialogauthorizationinstructor.h"
InstructorsAndTrainees::InstructorsAndTrainees(QString appPath):
dbLMS(new DataBaseLMS()),
dataBaseTrainees(new DataBaseTrainees(appPath, dbLMS)),
dataBaseInstructors(new DataBaseInstructors(appPath, dbLMS)),
appFilePath(appPath)
{
}
InstructorsAndTrainees::~InstructorsAndTrainees()
{
delete dataBaseTrainees;
delete dataBaseInstructors;
delete dbLMS;
}
void InstructorsAndTrainees::EditTrainees(QWidget* parent)
{
EditorTrainees editorTraineesGroups(dataBaseTrainees, &computersLocations, parent);
//dlg.setWindowTitle(tr("List trainees"));
//dlg.exec();
//dlg.show();
QDialog* dialog = new QDialog(parent);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorTraineesGroups);
dialog->setWindowTitle(tr("List trainees"));
dialog->setMinimumSize(1400, 800);
dialog->exec();
if(dbLMS == nullptr)
dataBaseTrainees->SaveTraineesGroupsXML();
else
dataBaseTrainees->LoadTraineesGroupsPSQL();
}
void InstructorsAndTrainees::EditInstructors(QWidget *parent)
{
EditorInstructors editorInstructors(dataBaseInstructors, parent);
//dlg.setWindowTitle(tr("List instructors"));
//dlg.exec();
//dlg.show();
QDialog* dialog = new QDialog(parent);
QHBoxLayout *layout = new QHBoxLayout(dialog);
layout->addWidget(&editorInstructors);
dialog->setWindowTitle(tr("List instructors"));
dialog->setMinimumSize(1400, 800);
dialog->exec();
if(dbLMS == nullptr)
dataBaseInstructors->SaveInstructorsXML();
else
dataBaseInstructors->LoadInstructorsPSQL();
}
bool InstructorsAndTrainees::authorizationInstructor(QWidget* parent)
{
DialogAuthorizationInstructor dlg(parent);
dlg.setWindowTitle(tr("Instructor authorithation"));
switch( dlg.exec() )
{
case QDialog::Accepted:
{
qDebug() << "Accepted";
QString login = dlg.getLogin();
QString password = dlg.getPassword();
return dataBaseInstructors->AuthorizationInstructor(login, password);
//break;
}
case QDialog::Rejected:
qDebug() << "Rejected";
break;
default:
qDebug() << "Unexpected";
}
return false;
}
bool InstructorsAndTrainees::authorizationTrainee(QString login, QString password, QString learnClass = QStringLiteral(""), QString computer = QStringLiteral(""))
{
return dataBaseTrainees->AuthorizationTrainee(login, password, learnClass, computer);
}
bool InstructorsAndTrainees::deAuthorizationTrainee(QString login)
{
return dataBaseTrainees->deAuthorizationTrainee(login);
}
bool InstructorsAndTrainees::authorizationInstructor(QString login, QString password)
{
return dataBaseInstructors->AuthorizationInstructor(login, password);
}
bool InstructorsAndTrainees::deAuthorizationInstructor(QString login)
{
return dataBaseInstructors->deAuthorizationInstructor(login);
}

View File

@@ -0,0 +1,63 @@
#ifndef INSTRUCTORSANDTRAINEES_H
#define INSTRUCTORSANDTRAINEES_H
#include "databaselms.h"
#include "instructorsAndTrainees_global.h"
#include "computersLocations.h"
#include "databasetrainees.h"
#include "databaseinstructors.h"
#include <QWidget>
class INSTRUCTORSANDTRAINEES_EXPORT InstructorsAndTrainees : QObject
{
Q_OBJECT
public:
InstructorsAndTrainees(QString appPath);
~InstructorsAndTrainees();
void EditTrainees(QWidget* parent = nullptr);
void EditInstructors(QWidget* parent = nullptr);
void addComputer(QString computer, QString location)
{
computersLocations.addComputer(computer, location);
}
DataBaseTrainees* getDataBaseTrainees()
{
return dataBaseTrainees;
}
DataBaseInstructors* getDataBaseInstructors()
{
return dataBaseInstructors;
}
//Авторизация инструктора локальная
bool authorizationInstructor(QWidget* parent = nullptr);
//Авторизация обучаемого на клиенте
bool authorizationTrainee(QString login, QString password, QString learnClass, QString computer);
bool deAuthorizationTrainee(QString login);
//Авторизация инструктора на клиенте
bool authorizationInstructor(QString login, QString password);
bool deAuthorizationInstructor(QString login);
private:
ComputersLocations computersLocations; //Компьютеры и их размещение по классам
DataBaseLMS* dbLMS;
DataBaseTrainees* dataBaseTrainees;
DataBaseInstructors* dataBaseInstructors;
QString appFilePath;
};
#endif // INSTRUCTORSANDTRAINEES_H

View File

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

View File

@@ -0,0 +1,25 @@
<RCC>
<qresource prefix="/">
<file>icons/addTrainee.png</file>
<file>icons/deleteGroup.png</file>
<file>icons/deleteTrainee.png</file>
<file>icons/edit.png</file>
<file>icons/group.png</file>
<file>icons/newGroup.png</file>
<file>icons/trainee.png</file>
<file>icons/archive.png</file>
<file>icons/traineeArchive.png</file>
<file>icons/circleGray.png</file>
<file>icons/circleGreen.png</file>
<file>icons/instructor.png</file>
<file>icons/instructorArchive.png</file>
<file>icons/addInstructor.png</file>
<file>icons/deleteInstructor.png</file>
<file>blankXML/groupsTrainees.xml</file>
<file>blankXML/instructors.xml</file>
<file>icons/instructorAdmin.png</file>
<file>icons/instructorFromArchive.png</file>
<file>icons/traineeFromArchive.png</file>
<file>icons/admin.png</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,45 @@
#include "taskswidget.h"
#include "ui_taskswidget.h"
TasksWidget::TasksWidget(DataBaseTrainees* db, QWidget *parent) :
QWidget(parent),
ui(new Ui::TasksWidget),
pDbTrainees(db)
{
ui->setupUi(this);
}
TasksWidget::~TasksWidget()
{
delete ui;
}
void TasksWidget::slot_traineeSelected(QString login)
{
viewListTasksForTrainee(login);
}
void TasksWidget::slot_LanguageChanged(QString language)
{
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + language, QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
}
void TasksWidget::viewListTasksForTrainee(QString login)
{
QStringList listTasks;
listTasks = pDbTrainees->getWhatItDoes(login);
ui->listWidgetTasks->clear();
ui->listWidgetTasks->addItems(listTasks);
}
void TasksWidget::changeEvent(QEvent *event)
{
// В случае получения события изменения языка приложения
if (event->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this); // переведём окно заново
}
}

View File

@@ -0,0 +1,41 @@
#ifndef TASKSWIDGET_H
#define TASKSWIDGET_H
#include <QWidget>
#include <QTranslator>
#include "instructorsAndTrainees_global.h"
#include "databasetrainees.h"
namespace Ui {
class TasksWidget;
}
class INSTRUCTORSANDTRAINEES_EXPORT TasksWidget : public QWidget
{
Q_OBJECT
public:
explicit TasksWidget(DataBaseTrainees* db, QWidget *parent = nullptr);
~TasksWidget();
protected:
// Метод получения событий
// В нём будет производиться проверка события смены перевода приложения
void changeEvent(QEvent * event) override;
public Q_SLOTS:
//слот обработки сигнала о выборе обучаемого
void slot_traineeSelected(QString login);
void slot_LanguageChanged(QString language);
private:
void viewListTasksForTrainee(QString login);
private:
Ui::TasksWidget *ui;
QTranslator qtLanguageTranslator;
DataBaseTrainees* pDbTrainees;
};
#endif // TASKSWIDGET_H

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TasksWidget</class>
<widget class="QWidget" name="TasksWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Task manager</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Task manager</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="listWidgetTasks"/>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,45 @@
#include "computersLocations.h"
ComputersLocations::ComputersLocations():
locations(),
computers(),
listComputerInLocation()
{
}
void ComputersLocations::addComputer(QString computer, QString location)
{
if(!computers.contains(computer))
{
computers.append(computer);
if(!locations.contains(location))
locations.append(location);
computerInLocation comp = {computer, location};
listComputerInLocation.append(comp);
}
}
QString ComputersLocations::getLocationOfComputer(QString computer)
{
for(computerInLocation compInLoc : listComputerInLocation)
{
if(computer == compInLoc.computer)
return compInLoc.location;
}
return QString(QStringLiteral(""));
}
QStringList ComputersLocations::getAllComputersOfLocation(QString location)
{
QStringList list;
for(computerInLocation compInLoc : listComputerInLocation)
{
if(location == compInLoc.location)
list.append(compInLoc.computer);
}
return list;
}

View File

@@ -0,0 +1,46 @@
#ifndef COMPUTERSLOCATIONS_H
#define COMPUTERSLOCATIONS_H
#include <QStringList>
#include "instructorsAndTrainees_global.h"
class INSTRUCTORSANDTRAINEES_EXPORT ComputersLocations
{
public:
ComputersLocations();
struct computerInLocation
{
QString computer;
QString location;
};
void clear()
{
listComputerInLocation.clear();
locations.clear();
computers.clear();
}
void addComputer(QString computer, QString location);
QStringList getAllLocations()
{
return locations;
}
QStringList getAllComputers()
{
return computers;
}
QString getLocationOfComputer(QString computer);
QStringList getAllComputersOfLocation(QString location);
private:
QStringList locations;
QStringList computers;
QList <computerInLocation> listComputerInLocation;
};
#endif // COMPUTERSLOCATIONS_H

View File

@@ -0,0 +1,587 @@
#include "databasetrainees.h"
#include <QDomDocument>
#include <QFile>
#include <QDebug>
DataBaseTrainees::DataBaseTrainees(QString appPath, DataBaseLMS* dbLMS)
{
listOfColorGroup.append(QColor(170, 190, 170));
listOfColorGroup.append(QColor(180, 180, 220));
listOfColorGroup.append(QColor(240, 220, 230));
listOfColorGroup.append(QColor(85, 170, 127));
listOfColorGroup.append(QColor(170, 115, 120));
listOfColorGroup.append(QColor(110, 160, 170));
listOfColorGroup.append(QColor(110, 170, 130));
listOfColorGroup.append(QColor(170, 170, 120));
listOfColorGroup.append(QColor(160, 170, 45));
listOfColorGroup.append(QColor(170, 140, 60));
listOfColorGroup.append(QColor(200, 200, 200));
appDirPath = appPath;
this->dbLMS = dbLMS;
if(this->dbLMS != nullptr)
LoadTraineesGroupsPSQL();
else
LoadTraineesGroupsXML();
}
DataBaseTrainees::~DataBaseTrainees()
{
if(dbLMS == nullptr)
SaveTraineesGroupsXML();
}
void DataBaseTrainees::LoadTraineesGroupsXML()
{
QDomDocument groupsTraineesDOM;
QString xmlFileName = appDirPath + QStringLiteral("/DBXML/groupsTrainees.xml");
QFile xmlInFile(xmlFileName);
if (!xmlInFile.open(QFile::ReadOnly | QFile::Text))
{
qDebug() << QStringLiteral("LoadTraineesGroupsXML: Не удалось открыть файл ") + xmlFileName;
return;
}
else
{
listOfTrainees.clear();
listOfGroups.clear();
groupsTraineesDOM.setContent(xmlInFile.readAll());
xmlInFile.close();
QDomNode groupsTraineesNode = groupsTraineesDOM.namedItem(QStringLiteral("groupsTrainees"));
for(int i = 0; i < groupsTraineesNode.childNodes().count(); i++)
{
QDomNode groupNode = groupsTraineesNode.childNodes().at(i);
if(groupNode.nodeName().toLower() == QStringLiteral("group"))
{//Группа
Group group;
group.setName(groupNode.toElement().attribute(QStringLiteral("name")));
group.setColor((Group::ColorGroup)(groupNode.toElement().attribute(QStringLiteral("color")).toInt()));
listOfGroups.append(group);
for(int j = 0; j < groupNode.childNodes().count(); j++)
{
QDomNode traineeNode = groupNode.childNodes().at(j);
if(traineeNode.nodeName().toLower() == QStringLiteral("trainee"))
{//Обучаемый
Trainee trainee;
trainee.setGroup(group.getName());
trainee.setName(traineeNode.toElement().attribute(QStringLiteral("name")));
trainee.setLogin(traineeNode.toElement().attribute(QStringLiteral("login")));
trainee.setPassword(traineeNode.toElement().attribute(QStringLiteral("password")));
trainee.setArchived(traineeNode.toElement().attribute(QStringLiteral("archived")) == QStringLiteral("да") ? true : false);
trainee.setWhatItDoes(traineeNode.toElement().attribute(QStringLiteral("whatItDoes")));
trainee.setLoggedIn(false);
trainee.setLearnClass(QStringLiteral(""));
trainee.setComputer(QStringLiteral(""));
listOfTrainees.append(trainee);
}
}
}
}//for(int i = 0; i < groupsTraineesNode.childNodes().count(); i++)
}//else
}
void DataBaseTrainees::SaveTraineesGroupsXML()
{
QDomDocument groupsTraineesDOM;
QFile blankFile(QStringLiteral(":/blankXML/groupsTrainees.xml"));
if (! blankFile.open(QFile::ReadOnly | QFile::Text)) {
qDebug() << "SaveTraineesGroupsXML: Не удалось считать файл :/blankXML/groupsTrainees.xml";
return;
}
groupsTraineesDOM.setContent(blankFile.readAll());
blankFile.close();
QDomNode groupsTraineesNode = groupsTraineesDOM.namedItem(QStringLiteral("groupsTrainees"));
for(Group group : listOfGroups)
{
//Группа
QDomNode groupNode = groupsTraineesDOM.createElement(QStringLiteral("group"));
groupsTraineesNode.appendChild(groupNode);
groupNode.toElement().setAttribute(QStringLiteral("name"), group.getName());
groupNode.toElement().setAttribute(QStringLiteral("color"), QString::number((int)group.getColor()));
//Обучаемые
QList<Trainee> listTrainees;
listTrainees = getListTraineesInGroup(group.getName());
for(Trainee trainee : listTrainees)
{
QDomNode traineeNode = groupsTraineesDOM.createElement(QStringLiteral("trainee"));
groupNode.appendChild(traineeNode);
traineeNode.toElement().setAttribute(QStringLiteral("name"), trainee.getName());
traineeNode.toElement().setAttribute(QStringLiteral("login"), trainee.getLogin());
traineeNode.toElement().setAttribute(QStringLiteral("password"), trainee.getPassword());
traineeNode.toElement().setAttribute(QStringLiteral("archived"), trainee.getArchived() ? QStringLiteral("да") : QStringLiteral("нет"));
traineeNode.toElement().setAttribute(QStringLiteral("whatItDoes"), trainee.getWhatItDoes());
}
}
QString xmlFileName = appDirPath + QStringLiteral("/DBXML/groupsTrainees.xml");
QFile xmlOutFile(xmlFileName);
if (!xmlOutFile.open(QFile::WriteOnly | QFile::Text))
{
qDebug() << QStringLiteral("SaveTraineesGroupsXML: Не удалось записать файл ") + xmlFileName;
return;
}
QTextStream outFile(&xmlOutFile);
groupsTraineesDOM.save(outFile, 4);
xmlOutFile.close();
}
void DataBaseTrainees::LoadTraineesGroupsPSQL()
{
listOfTrainees.clear();
listOfGroups.clear();
listOfTrainees = dbLMS->selectAllTrainees();
listOfGroups = dbLMS->selectAllGroups();
}
bool DataBaseTrainees::AuthorizationTrainee(QString login, QString password, QString learnClass, QString computer)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getArchived())
continue;
if(listOfTrainees[i].getLogin() == login && listOfTrainees[i].getPassword() == password)
{
listOfTrainees[i].setLoggedIn(true);
listOfTrainees[i].setLearnClass(learnClass);
listOfTrainees[i].setComputer(computer);
return true;
}
}
return false;
}
bool DataBaseTrainees::deAuthorizationTrainee(QString login)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
//if(listOfTrainees[i].getArchived())
//continue;
if(listOfTrainees[i].getLogin() == login)
{
listOfTrainees[i].setLoggedIn(false);
listOfTrainees[i].setLearnClass(QStringLiteral(""));
listOfTrainees[i].setComputer(QStringLiteral(""));
return true;
}
}
return false;
}
void DataBaseTrainees::setWhatItDoes(QString login, QString whatItDoes)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getLogin() == login)
listOfTrainees[i].setWhatItDoes(whatItDoes);
}
}
QStringList DataBaseTrainees::getWhatItDoes(QString login)
{
QString whatItDoes = QStringLiteral("");
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getLogin() == login)
whatItDoes = listOfTrainees[i].getWhatItDoes();
}
return whatItDoes.split(QStringLiteral(";"));
}
QString DataBaseTrainees::getNameTraineeOnComputer(QString computer)
{
for(Trainee trainee : listOfTrainees)
{
if(trainee.getComputer() == computer)
return trainee.getName();
}
return QString(QStringLiteral(""));
}
Trainee DataBaseTrainees::getTraineeOnComputer(QString computer)
{
for(Trainee trainee : listOfTrainees)
{
if(trainee.getComputer() == computer)
return trainee;
}
return Trainee();
}
QString DataBaseTrainees::getNameTraineeByLogin(QString login)
{
for(Trainee trainee : listOfTrainees)
{
if(trainee.getLogin() == login)
return trainee.getName();
}
return QString(QStringLiteral(""));
}
QColor DataBaseTrainees::getColorGroupByLogin(QString login)
{
QString nameTrainee = getNameTraineeByLogin(login);
Trainee trainee = getTrainee(nameTrainee);
QString nameGroup = trainee.getGroup();
Group group = getGroup(nameGroup);
return getColorGroup(group.getColor());
}
QList<Trainee> DataBaseTrainees::getListTraineesInGroup(QString nameGroup)
{
QList<Trainee> listTrainees;
for(Trainee trainee : listOfTrainees)
{
if(trainee.getGroup() == nameGroup)
listTrainees.append(trainee);
}
return listTrainees;
}
QList<Group> DataBaseTrainees::getListGroups()
{
return listOfGroups;
}
QColor DataBaseTrainees::getColorGroup(Group::ColorGroup numColor)
{
if(numColor > listOfColorGroup.count() - 1)
return listOfColorGroup.at(Group::ColorGroup::colorAther);
return listOfColorGroup.at(numColor);
}
Trainee DataBaseTrainees::getTrainee(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
return listOfTrainees[i];
}
return Trainee();
}
Group DataBaseTrainees::getGroup(QString nameGroup)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getName() == nameGroup)
return listOfGroups[i];
}
return Group();
}
QString DataBaseTrainees::newGroup()
{
Group group;
group.setName(generateDefaultNameGroup());
group.setColor(generateDefaultColorGroup());
bool result = dbLMS->insertGroup(group);
if(result)
{
listOfGroups.append(group);
return group.getName();
}
else
return QStringLiteral("");
}
bool DataBaseTrainees::deleteGroup(QString name)
{
if(getListTraineesInGroup(name).count() > 0)
{//Группа не пуста
return false;
}
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getName() == name)
{
int id = listOfGroups[i].getID();
bool result = dbLMS->deleteGroup(id);
if(result)
listOfGroups.removeAt(i);
break;
}
}
return true;
}
bool DataBaseTrainees::editGroup(QString name, QString newName)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getName() == name)
{
if(!checkExistNameGroup(newName) || newName == name)
{
Group group = listOfGroups[i];
group.setName(newName);
bool result = dbLMS->updateGroup(group);
if(result)
{
listOfGroups[i].setName(newName);
//Меняем имя группы у всех Обучаемых этой группы
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getGroup() == name)
listOfTrainees[i].setGroup(newName);
}
return true;
}
else
return false;
}
}
}
return false;
}
QString DataBaseTrainees::newTrainee(QString nameGroup)
{
Trainee trainee;
trainee.setGroup(nameGroup);
trainee.setName(generateDefaultNameTrainee());
trainee.setLogin(generateDefaultLoginTrainee());
trainee.setPassword(QStringLiteral("<password>"));
trainee.setLearnClass(QStringLiteral(""));
trainee.setComputer(QStringLiteral(""));
trainee.setArchived(false);
trainee.setLoggedIn(false);
trainee.setWhatItDoes(QStringLiteral(""));
bool result = dbLMS->insertTrainee(trainee);
if(result)
{
listOfTrainees.append(trainee);
return trainee.getName();
}
else
return QStringLiteral("");
}
void DataBaseTrainees::deleteTrainee(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
{
int id = listOfTrainees[i].getID();
bool result = dbLMS->deleteTrainee(id);
if(result)
listOfTrainees.removeAt(i);
return;
}
}
}
void DataBaseTrainees::toArchiveTrainee(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
if(! listOfTrainees[i].getArchived())
{
Trainee trainee = listOfTrainees[i];
trainee.setArchived(true);
bool result = dbLMS->updateTrainee(trainee);
if(result)
listOfTrainees[i].setArchived(true);
}
}
}
void DataBaseTrainees::fromeArchiveTrainee(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
if(listOfTrainees[i].getArchived())
{
Trainee trainee = listOfTrainees[i];
trainee.setArchived(false);
bool result = dbLMS->updateTrainee(trainee);
if(result)
listOfTrainees[i].setArchived(false);
}
}
}
bool DataBaseTrainees::editTrainee(QString name, Trainee trainee)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
{
if( (!checkExistNameTrainee(trainee.getName()) || trainee.getName() == name) &&
(!checkExistLoginTrainee(trainee.getLogin()) || trainee.getLogin() == listOfTrainees[i].getLogin()) )
{
trainee.setID(listOfTrainees[i].getID());
bool result = dbLMS->updateTrainee(trainee);
if(result)
{
listOfTrainees.replace(i, trainee);
return true;
}
else
return false;
}
}
}
return false;
}
bool DataBaseTrainees::isArchived(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
return listOfTrainees[i].getArchived();
}
return false;
}
QString DataBaseTrainees::generateDefaultNameGroup()
{
int numGroup = 0;
QString name;
do
{
name = tr("Group") + QStringLiteral(" ") + QString::number(++numGroup);
}while(checkExistNameGroup(name));
return name;
}
QString DataBaseTrainees::generateDefaultNameTrainee()
{
int numTrainee = 0;
QString name;
do
{
name = QStringLiteral("<") + tr("Trainee") + QStringLiteral(" ") + QString::number(++numTrainee) + QStringLiteral(">");
}while(checkExistNameTrainee(name));
return name;
}
bool DataBaseTrainees::checkExistNameGroup(QString name)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getName() == name)
return true;
}
return false;
}
bool DataBaseTrainees::checkExistNameTrainee(QString name)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getName() == name)
return true;
}
return false;
}
QString DataBaseTrainees::generateDefaultLoginTrainee()
{
int numTrainee = 0;
QString login;
do
{
login = QStringLiteral("<O") + QString::number(++numTrainee) + QStringLiteral(">");
}while(checkExistLoginTrainee(login));
return login;
}
bool DataBaseTrainees::checkExistLoginTrainee(QString login)
{
//Обучаемые
for(int i = 0; i < listOfTrainees.count(); i++)
{
if(listOfTrainees[i].getLogin() == login)
return true;
}
return false;
}
Group::ColorGroup DataBaseTrainees::generateDefaultColorGroup()
{
for(int i = 0; i < Group::ColorGroup::countColor; i++)
{
Group::ColorGroup color = (Group::ColorGroup)i;
if(!checkExistColorGroup(color))
return color;
}
return Group::ColorGroup::colorAther;
}
bool DataBaseTrainees::checkExistColorGroup(Group::ColorGroup color)
{
//Группы
for(int i = 0; i < listOfGroups.count(); i++)
{
if(listOfGroups[i].getColor() == color)
return true;
}
return false;
}

View File

@@ -0,0 +1,82 @@
#ifndef DATABASETRAINEES_H
#define DATABASETRAINEES_H
#include "instructorsAndTrainees_global.h"
#include "trainee.h"
#include "group.h"
#include "databaselms.h"
#include <QList>
#include <QColor>
#include <QObject>
class INSTRUCTORSANDTRAINEES_EXPORT DataBaseTrainees : QObject
{
Q_OBJECT
public:
DataBaseTrainees(QString appPath, DataBaseLMS* dbLMS = nullptr);
~DataBaseTrainees();
void LoadTraineesGroupsXML();
void SaveTraineesGroupsXML();
void LoadTraineesGroupsPSQL();
bool AuthorizationTrainee(QString login, QString password, QString learnClass, QString computer);
bool deAuthorizationTrainee(QString login);
void setWhatItDoes(QString login, QString whatItDoes);
QStringList getWhatItDoes(QString login);
QString getNameTraineeOnComputer(QString computer);
Trainee getTraineeOnComputer(QString computer);
QString getNameTraineeByLogin(QString login);
QColor getColorGroupByLogin(QString login);
QList<Trainee> getListTraineesInGroup(QString nameGroup);
QList<Group> getListGroups();
QColor getColorGroup(Group::ColorGroup numColor);
Trainee getTrainee(QString name);
Group getGroup(QString nameGroup);
QString newGroup();
bool deleteGroup(QString name);
bool editGroup(QString name, QString newName);
QString newTrainee(QString nameGroup);
void deleteTrainee(QString name);
void toArchiveTrainee(QString name);
void fromeArchiveTrainee(QString name);
bool editTrainee(QString name, Trainee trainee);
bool isArchived(QString name);
private:
QString generateDefaultNameGroup();
QString generateDefaultNameTrainee();
bool checkExistNameGroup(QString name);
bool checkExistNameTrainee(QString name);
QString generateDefaultLoginTrainee();
bool checkExistLoginTrainee(QString login);
Group::ColorGroup generateDefaultColorGroup();
bool checkExistColorGroup(Group::ColorGroup color);
private:
QList<Trainee> listOfTrainees;
QList<Group> listOfGroups;
QList<QColor> listOfColorGroup;
QString appDirPath;
DataBaseLMS* dbLMS;
};
#endif // DATABASETRAINEES_H

View File

@@ -0,0 +1,14 @@
#include "dialogeditgroup.h"
#include "computersLocations.h"
DialogEditGroup::DialogEditGroup(QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogEditGroup)
{
ui->setupUi(this);
}
DialogEditGroup::~DialogEditGroup()
{
delete ui;
}

View File

@@ -0,0 +1,34 @@
#ifndef DIALOGEDITGROUP_H
#define DIALOGEDITGROUP_H
#include <QDialog>
#include "ui_dialogeditgroup.h"
#include "computersLocations.h"
namespace Ui {
class DialogEditGroup;
}
class DialogEditGroup : public QDialog
{
Q_OBJECT
public:
explicit DialogEditGroup(QWidget *parent = nullptr);
~DialogEditGroup();
void setName(QString name)
{
ui->editName->setText(name);
}
QString getName()
{
return ui->editName->text();
}
private:
Ui::DialogEditGroup *ui;
};
#endif // DIALOGEDITGROUP_H

View File

@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogEditGroup</class>
<widget class="QDialog" name="DialogEditGroup">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>96</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="windowTitle">
<string>Group</string>
</property>
<property name="windowIcon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/group.png</normaloff>:/icons/group.png</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editName"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogEditGroup</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogEditGroup</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,46 @@
#include "dialogedittrainee.h"
#include "ui_dialogedittrainee.h"
#include "computersLocations.h"
DialogEditTrainee::DialogEditTrainee(ComputersLocations* computersLocations, QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogEditTrainee),
computersLocations(computersLocations),
nameGroup()
{
ui->setupUi(this);
}
DialogEditTrainee::~DialogEditTrainee()
{
delete ui;
}
void DialogEditTrainee::setTrainee(Trainee trainee)
{
ui->editName->setText(trainee.getName());
ui->editLogin->setText(trainee.getLogin());
ui->editPassword->setText(trainee.getPassword());
ui->checkArchived->setChecked(trainee.getArchived());
ui->checkLoggedIn->setChecked(trainee.getLoggedIn());
nameGroup = trainee.getGroup();
}
Trainee DialogEditTrainee::getTrainee()
{
Trainee trainee;
trainee.setName(ui->editName->text());
trainee.setLogin(ui->editLogin->text());
trainee.setPassword(ui->editPassword->text());
trainee.setLearnClass(QStringLiteral(""));
trainee.setComputer(QStringLiteral(""));
trainee.setArchived(ui->checkArchived->isChecked());
trainee.setLoggedIn(ui->checkLoggedIn->isChecked());
trainee.setWhatItDoes(QStringLiteral(""));
trainee.setGroup(nameGroup);
return trainee;
}

View File

@@ -0,0 +1,64 @@
#include "dialogedittrainee.h"
#include "ui_dialogedittrainee.h"
#include "computersLocations.h"
DialogEditTrainee::DialogEditTrainee(ComputersLocations* computersLocations, QWidget *parent) :
QDialog(parent),
ui(new Ui::DialogEditTrainee),
computersLocations(computersLocations),
nameGroup()
{
ui->setupUi(this);
ui->comboLocation->clear();
ui->comboLocation->addItems(computersLocations->getAllLocations());
ui->comboLocation->setCurrentIndex(0);
//setLocation(getLocation());
ui->comboComputer->clear();
ui->comboComputer->addItems(computersLocations->getAllComputersOfLocation(ui->comboLocation->currentText()));
}
DialogEditTrainee::~DialogEditTrainee()
{
delete ui;
}
void DialogEditTrainee::setTrainee(Trainee trainee)
{
ui->editName->setText(trainee.getName());
ui->editLogin->setText(trainee.getLogin());
ui->editPassword->setText(trainee.getPassword());
ui->comboLocation->setCurrentText(trainee.getLearnClass());
ui->comboComputer->clear();
ui->comboComputer->addItems(computersLocations->getAllComputersOfLocation(ui->comboLocation->currentText()));
ui->comboComputer->setCurrentText(trainee.getComputer());
ui->checkArchived->setChecked(trainee.getArchived());
ui->checkLoggedIn->setChecked(trainee.getLoggedIn());
ui->editWhatItDoes->setText(trainee.getWhatItDoes());
nameGroup = trainee.getGroup();
}
Trainee DialogEditTrainee::getTrainee()
{
Trainee trainee;
trainee.setName(ui->editName->text());
trainee.setLogin(ui->editLogin->text());
trainee.setPassword(ui->editPassword->text());
trainee.setLearnClass(ui->comboLocation->currentText());
trainee.setComputer(ui->comboComputer->currentText());
trainee.setArchived(ui->checkArchived->isChecked());
trainee.setLoggedIn(ui->checkLoggedIn->isChecked());
trainee.setWhatItDoes(ui->editWhatItDoes->text());
trainee.setGroup(nameGroup);
return trainee;
}
void DialogEditTrainee::on_comboLocation_currentIndexChanged(const QString &arg1)
{
ui->comboComputer->clear();
ui->comboComputer->addItems(computersLocations->getAllComputersOfLocation(arg1));
}

View File

@@ -0,0 +1,30 @@
#ifndef DIALOGEDITTRAINEE_H
#define DIALOGEDITTRAINEE_H
#include <QDialog>
#include "trainee.h"
#include "computersLocations.h"
namespace Ui {
class DialogEditTrainee;
}
class DialogEditTrainee : public QDialog
{
Q_OBJECT
public:
explicit DialogEditTrainee(ComputersLocations* computersLocations, QWidget *parent = nullptr);
~DialogEditTrainee();
void setTrainee(Trainee trainee);
Trainee getTrainee();
private:
Ui::DialogEditTrainee *ui;
ComputersLocations* computersLocations;
QString nameGroup;
};
#endif // DIALOGEDITTRAINEE_H

View File

@@ -0,0 +1,33 @@
#ifndef DIALOGEDITTRAINEE_H
#define DIALOGEDITTRAINEE_H
#include <QDialog>
#include "trainee.h"
#include "computersLocations.h"
namespace Ui {
class DialogEditTrainee;
}
class DialogEditTrainee : public QDialog
{
Q_OBJECT
public:
explicit DialogEditTrainee(ComputersLocations* computersLocations, QWidget *parent = nullptr);
~DialogEditTrainee();
void setTrainee(Trainee trainee);
Trainee getTrainee();
private slots:
void on_comboLocation_currentIndexChanged(const QString &arg1);
private:
Ui::DialogEditTrainee *ui;
ComputersLocations* computersLocations;
QString nameGroup;
};
#endif // DIALOGEDITTRAINEE_H

View File

@@ -0,0 +1,165 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DialogEditTrainee</class>
<widget class="QDialog" name="DialogEditTrainee">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>252</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="windowTitle">
<string>Trainee</string>
</property>
<property name="windowIcon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/trainee.png</normaloff>:/icons/trainee.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editName"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Login</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editLogin"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Password</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editPassword"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="checkArchived">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Archived</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/archive.png</normaloff>
<disabledoff>:/icons/archive.png</disabledoff>:/icons/archive.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="checkLoggedIn">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Logged</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/circleGreen.png</normaloff>
<disabledoff>:/icons/circleGreen.png</disabledoff>:/icons/circleGreen.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>DialogEditTrainee</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>DialogEditTrainee</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@@ -0,0 +1,280 @@
#include <QMessageBox>
#include "editortrainees.h"
#include "ui_editortrainees.h"
#include "dialogeditgroup.h"
#include "dialogedittrainee.h"
EditorTrainees::EditorTrainees(DataBaseTrainees* db, ComputersLocations* computersLocations, QWidget *parent) :
//QDialog(parent),
TraineesView(db, CommonView::TypeView::control, parent),
ui(new Ui::EditorTrainees),
computersLocations(computersLocations)
{
ui->setupUi((QDialog*)this);
preparationTreeWidget(ui->treeWidget);
setNotLoggedInVisible(true);
loadTraineesFromDB();
}
EditorTrainees::~EditorTrainees()
{
delete ui;
}
void EditorTrainees::on_btnNewGroup_clicked()
{
QString nameGroup = dbTrainees->newGroup();
loadTraineesFromDB();
setCurrentGroup(nameGroup);
}
void EditorTrainees::on_btnDeleteGroup_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent != nullptr)
{
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбрана группа
QString name = treeItemCurrent->text(0);
if(dbTrainees->deleteGroup(name))
{//Удалено
loadTraineesFromDB();
}
else
QMessageBox::critical(this, tr("Editing error!"), tr("The group is not empty.\nIt is not possible to delete a non-empty group."));
}
}
}
void EditorTrainees::on_btnNewTrainee_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent != nullptr)
{
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбрана группа. Можно добавить Обучаемого
QString nameGroup = treeItemCurrent->text(0);
dbTrainees->newTrainee(nameGroup);
loadTraineesFromDB();
setCurrentGroup(nameGroup);
}
}
}
void EditorTrainees::on_btnDeleteTrainee_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent != nullptr)
{
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent != nullptr)
{//Выбран обучаемый
QString name = treeItemCurrent->text(0);
QString nameGroup = treeItemParent->text(0);
if(QMessageBox::warning(this, tr("Attention!"), tr("The deletion will be irrevocable.\nDelete anyway?"), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok)
{
dbTrainees->deleteTrainee(name);
loadTraineesFromDB();
setCurrentGroup(nameGroup);
}
}
}
}
void EditorTrainees::on_btnToOrFromArchiveTrainee_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent != nullptr)
{
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent != nullptr)
{//Выбран обучаемый
QString name = treeItemCurrent->text(0);
if(dbTrainees->isArchived(name))
{//Архивный
dbTrainees->fromeArchiveTrainee(name);
loadTraineesFromDB();
setCurrentTrainee(name);
}
else
{//Не Архивный
dbTrainees->toArchiveTrainee(name);
if(!archiveVisible)
ui->btnArchive->click();
loadTraineesFromDB();
setCurrentTrainee(name);
}
}
}
}
void EditorTrainees::on_btnEdit_clicked()
{
QTreeWidgetItem *treeItemCurrent = ui->treeWidget->currentItem();
if(treeItemCurrent == nullptr)
return;
QTreeWidgetItem *treeItemParent = treeItemCurrent->parent();
if(treeItemParent == nullptr)
{//Выбрана группа
QString nameGroup = treeItemCurrent->text(0);
DialogEditGroup dlg(this);
dlg.setName(nameGroup);
switch( dlg.exec() )
{
case QDialog::Accepted:
{
if(dbTrainees->editGroup(nameGroup, dlg.getName()))
{
loadTraineesFromDB();
setCurrentGroup(dlg.getName());
}
else
QMessageBox::critical(this, tr("Editing error!"),
tr("An existing group name has been entered.\nThe changes will not be accepted."));
break;
}
case QDialog::Rejected:
break;
default:
break;
}
}
else
{//Выбран обучаемый
QString name = treeItemCurrent->text(0);
DialogEditTrainee dlg(computersLocations, this);
dlg.setTrainee(dbTrainees->getTrainee(name));
switch( dlg.exec() )
{
case QDialog::Accepted:
{
if(dbTrainees->editTrainee(name, dlg.getTrainee()))
{
loadTraineesFromDB();
setCurrentTrainee(dlg.getTrainee().getName());
}
else
QMessageBox::critical(this, tr("Editing error!"),
tr("An existing trainee's name or login has been entered.\nThe changes will not be accepted."));
break;
}
case QDialog::Rejected:
break;
default:
break;
}
}
}
void EditorTrainees::on_btnArchive_clicked()
{
bool state = ui->btnArchive->isChecked();
setArchiveVisible(state);
loadTraineesFromDB();
}
void EditorTrainees::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
{
//Определяем доступность и функционал кнопок для выбранного элемента
if(current == nullptr)
return;
QTreeWidgetItem *treeItemParent = current->parent();
if(treeItemParent == nullptr)
{//Выбрана группа
ui->btnNewGroup->setEnabled(true);
ui->btnDeleteGroup->setEnabled(true);
ui->btnNewTrainee->setEnabled(true);
ui->btnDeleteTrainee->setEnabled(false);
ui->btnToOrFromArchiveTrainee->setEnabled(false);
ui->btnEdit->setEnabled(true);
ui->btnArchive->setEnabled(true);
ui->btnToOrFromArchiveTrainee->setText(tr("To archive"));
ui->btnToOrFromArchiveTrainee->setIcon(QIcon(QStringLiteral(":/icons/traineeArchive.png")));
}
else
{//Выбран обучаемый
QString name = current->text(0);
ui->btnNewGroup->setEnabled(false);
ui->btnDeleteGroup->setEnabled(false);
ui->btnNewTrainee->setEnabled(false);
if(dbTrainees->isArchived(name))
{//Архивный
ui->btnDeleteTrainee->setEnabled(true);
ui->btnToOrFromArchiveTrainee->setText(tr("From archive"));
ui->btnToOrFromArchiveTrainee->setIcon(QIcon(QStringLiteral(":/icons/traineeFromArchive.png")));
}
else
{//Не Архивный
ui->btnDeleteTrainee->setEnabled(false);
ui->btnToOrFromArchiveTrainee->setText(tr("To archive"));
ui->btnToOrFromArchiveTrainee->setIcon(QIcon(QStringLiteral(":/icons/traineeArchive.png")));
}
ui->btnToOrFromArchiveTrainee->setEnabled(true);
ui->btnEdit->setEnabled(true);
ui->btnArchive->setEnabled(true);
}
}
void EditorTrainees::setCurrentGroup(QString nameGroup)
{
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
if(item != nullptr)
if(item->text(0) == nameGroup)
{
treeWidget->setCurrentItem(item);
break;
}
}
}
void EditorTrainees::setCurrentTrainee(QString name)
{
for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(i);
if(item != nullptr)
{
for (int j = 0; j < item->childCount(); j++)
{
QTreeWidgetItem * itemChild = item->child(j);
if(itemChild != nullptr)
if(itemChild->text(0) == name)
{
treeWidget->setCurrentItem(itemChild);
break;
}
}//for (int j = 0; j < item->childCount(); j++)
}
}//for(int i = 0; i < treeWidget->topLevelItemCount(); i++)
}

View File

@@ -0,0 +1,43 @@
#ifndef DIALOGTRAINEESGROUPS_H
#define DIALOGTRAINEESGROUPS_H
#include <QDialog>
#include <QTreeWidget>
#include "computersLocations.h"
#include "databasetrainees.h"
#include "traineesview.h"
namespace Ui {
class EditorTrainees;
}
//Диалог для просмотра и управления БД Обучаемых
class EditorTrainees : /*public QDialog,*/ public TraineesView
{
Q_OBJECT
public:
explicit EditorTrainees(DataBaseTrainees* db, ComputersLocations* computersLocations, QWidget *parent = nullptr);
~EditorTrainees();
private Q_SLOTS:
void on_btnNewGroup_clicked();
void on_btnDeleteGroup_clicked();
void on_btnNewTrainee_clicked();
void on_btnDeleteTrainee_clicked();
void on_btnToOrFromArchiveTrainee_clicked();
void on_btnEdit_clicked();
void on_btnArchive_clicked();
void on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
private:
void setCurrentGroup(QString nameGroup);
void setCurrentTrainee(QString name);
private:
Ui::EditorTrainees *ui;
ComputersLocations* computersLocations;
};
#endif // DIALOGTRAINEESGROUPS_H

View File

@@ -0,0 +1,390 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditorTrainees</class>
<widget class="QDialog" name="EditorTrainees">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1300</width>
<height>800</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>List trainees</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QWidget" name="widget" native="true">
<property name="font">
<font>
<pointsize>12</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(240, 240, 240);</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_1">
<item>
<layout class="QVBoxLayout" name="verticalLayout_1">
<item>
<widget class="QTreeWidget" name="treeWidget">
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="columnCount">
<number>1</number>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(180, 180, 180);</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QToolButton" name="btnNewGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>New group</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/newGroup.png</normaloff>:/icons/newGroup.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnDeleteGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Delete group</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/deleteGroup.png</normaloff>:/icons/deleteGroup.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnNewTrainee">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>New trainee</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/addTrainee.png</normaloff>:/icons/addTrainee.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnDeleteTrainee">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Delete trainee</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/deleteTrainee.png</normaloff>:/icons/deleteTrainee.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnToOrFromArchiveTrainee">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>To archive</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/traineeArchive.png</normaloff>:/icons/traineeArchive.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Edit</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/edit.png</normaloff>:/icons/edit.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="btnArchive">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>55</height>
</size>
</property>
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Show archive</string>
</property>
<property name="icon">
<iconset resource="../resources.qrc">
<normaloff>:/icons/archive.png</normaloff>:/icons/archive.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="../resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,132 @@
#include <QHeaderView>
#include "traineesview.h"
TraineesView::TraineesView(DataBaseTrainees* db, TypeView type, QWidget *parent):
CommonView(type, parent),
dbTrainees(db)
{
}
void TraineesView::preparationTreeWidget(QTreeWidget *tree)
{
treeWidget = tree;
if(treeWidget == nullptr)
return;
treeWidget->setColumnCount(8);
reSetHeadTreeWidget();
treeWidget->header()->setStyleSheet(QStringLiteral("font-size: 12pt;"));
treeWidget->setColumnWidth(0, 200);
treeWidget->setColumnWidth(1, 130);
treeWidget->setColumnWidth(2, 130);
treeWidget->setColumnWidth(3, 130);
treeWidget->setColumnWidth(4, 130);
treeWidget->setColumnWidth(5, 130);
treeWidget->setColumnWidth(6, 130);
treeWidget->setColumnWidth(7, 100);
if(typeView == TypeView::onlyView)
{//onlyView
treeWidget->setColumnHidden(1, true);
treeWidget->setColumnHidden(2, true);
treeWidget->setColumnHidden(5, true);
treeWidget->setColumnHidden(7, true);
}
else
{//control
treeWidget->setColumnHidden(5, true);
}
}
void TraineesView::loadTraineesFromDB()
{
if(treeWidget == nullptr)
return;
//Обновление дерева
treeWidget->clear();
for(Group group : dbTrainees->getListGroups())
{
//Группа
QTreeWidgetItem *ItemGroup = new QTreeWidgetItem(treeWidget);
ItemGroup->setText(0, group.getName());
ItemGroup->setIcon(0, QIcon(QStringLiteral(":/icons/group.png")));
QColor color = dbTrainees->getColorGroup(/*group.getColor()*/Group::color0);
setItemColor(ItemGroup, color);
//Обучаемые
QList<Trainee> listTrainees;
listTrainees = dbTrainees->getListTraineesInGroup(group.getName());
for(Trainee trainee : listTrainees)
{
QTreeWidgetItem *ItemTrainee = new QTreeWidgetItem();
ItemTrainee->setText(0, trainee.getName());
ItemTrainee->setText(1, trainee.getLogin());
ItemTrainee->setText(2, trainee.getPassword());
ItemTrainee->setText(3, trainee.getLearnClass());
ItemTrainee->setText(4, trainee.getComputer());
if(trainee.getArchived())
{//Архивный
ItemTrainee->setText(5, tr("yes"));
ItemTrainee->setIcon(0, QIcon(QStringLiteral(":/icons/traineeArchive.png")));
setItemColorArchive(ItemTrainee);
}
else
{//Не Архивный
ItemTrainee->setText(5, tr("no"));
ItemTrainee->setIcon(0, QIcon(QStringLiteral(":/icons/trainee.png")));
setItemColorNoArchive(ItemTrainee);
}
if(trainee.getLoggedIn())
{//Залогинен
ItemTrainee->setText(6, tr("yes"));
ItemTrainee->setIcon(6, QIcon(QStringLiteral(":/icons/circleGreen.png")));
}
else
{//Не Залогинен
ItemTrainee->setText(6, tr("no"));
ItemTrainee->setIcon(6, QIcon(QStringLiteral(":/icons/circleGray.png")));
}
ItemTrainee->setText(7, trainee.getWhatItDoes());
ItemGroup->addChild(ItemTrainee);
//Скрываем архивных (при необходимости)
if(trainee.getArchived())
if(!archiveVisible)
ItemTrainee->setHidden(true);
//Скрываем незалогиненых (при необходимости)
if(! trainee.getLoggedIn())
if(! notLoggedInVisible)
ItemTrainee->setHidden(true);
}
}
treeWidget->setSortingEnabled(true);
treeWidget->sortItems(0, Qt::SortOrder::AscendingOrder);
treeWidget->expandAll();
if(typeView == TypeView::control)
{
QTreeWidgetItem * item = treeWidget->topLevelItem(0);
if(item != nullptr)
treeWidget->setCurrentItem(item);
}
}
void TraineesView::reSetHeadTreeWidget()
{
QStringList listHeaders = {tr("Trainee"), tr("Login"), tr("Password"), tr("Class"), tr("Computer"), tr("Archived"), tr("Logged"), tr("Tasks")};
treeWidget->setHeaderLabels(listHeaders);
}

View File

@@ -0,0 +1,27 @@
#ifndef TRAINEESVIEW_H
#define TRAINEESVIEW_H
#include "instructorsAndTrainees_global.h"
#include "databasetrainees.h"
#include "commonview.h"
//Родительский класс представления БД Обучаемых (для просмотра и управления)
class INSTRUCTORSANDTRAINEES_EXPORT TraineesView: public CommonView
{
Q_OBJECT
public:
TraineesView(DataBaseTrainees* db, TypeView type, QWidget *parent = nullptr);
protected:
void preparationTreeWidget(QTreeWidget* tree);
void loadTraineesFromDB();
void reSetHeadTreeWidget();
protected:
DataBaseTrainees* dbTrainees;
};
#endif // TRAINEESVIEW_H

View File

@@ -0,0 +1,75 @@
#include "viewertrainees.h"
#include "ui_viewertrainees.h"
ViewerTrainees::ViewerTrainees(DataBaseTrainees* db, QWidget *parent) :
//QWidget(parent),
TraineesView(db, CommonView::TypeView::onlyView, parent),
ui(new Ui::ViewerTrainees)
{
ui->setupUi(this);
// Сделаем первоначальную инициализацию перевода для окна виджета
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + QString(QStringLiteral("ru_RU")), QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
preparationTreeWidget(ui->treeWidget);
setNotLoggedInVisible(true);
loadTraineesFromDB();
}
ViewerTrainees::~ViewerTrainees()
{
delete ui;
}
void ViewerTrainees::setFilterTraineeLoggedIn(bool enabled)
{
setNotLoggedInVisible(!enabled);
loadTraineesFromDB();
}
void ViewerTrainees::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
{
if(item->childCount() == 0)
{//Выбран обучаемый
QString login = item->text(1);
Q_EMIT signal_traineeSelected(login);
}
}
void ViewerTrainees::slot_tabMessengerChanged(QString login)
{
for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)
{//Проход по группам
int countChild = ui->treeWidget->topLevelItem(i)->childCount();
for (int j = 0; j < countChild; j++)
{//Проход по обучаемым
QString loginChild = ui->treeWidget->topLevelItem(i)->child(j)->text(1);
if(loginChild == login)
{
ui->treeWidget->setCurrentItem(ui->treeWidget->topLevelItem(i)->child(j));
Q_EMIT signal_traineeSelected(login);
return;
}
}
}
}
void ViewerTrainees::changeEvent(QEvent *event)
{
// В случае получения события изменения языка приложения
if (event->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this); // переведём окно заново
reSetHeadTreeWidget();
loadTraineesFromDB();
}
}
void ViewerTrainees::slot_LanguageChanged(QString language)
{
qtLanguageTranslator.load(QString(QStringLiteral("translations/InstructorsAndTrainees_")) + language, QStringLiteral("."));
qApp->installTranslator(&qtLanguageTranslator);
}

View File

@@ -0,0 +1,56 @@
#ifndef TRAINEESWIDGET_H
#define TRAINEESWIDGET_H
#include <QWidget>
#include <QObject>
#include <QEvent>
#include "instructorsAndTrainees_global.h"
#include "databasetrainees.h"
#include "traineesview.h"
namespace Ui {
class ViewerTrainees;
}
//Виджет только для просмотра БД Обучаемых
class INSTRUCTORSANDTRAINEES_EXPORT ViewerTrainees : /*public QWidget,*/ public TraineesView
{
Q_OBJECT
public:
explicit ViewerTrainees(DataBaseTrainees* db, QWidget *parent = nullptr);
~ViewerTrainees();
protected:
// Метод получения событий
// В нём будет производиться проверка события смены перевода приложения
void changeEvent(QEvent * event) override;
public Q_SLOTS:
void slot_LanguageChanged(QString language);
public:
void updateTrainees()
{
loadTraineesFromDB();
}
void setFilterTraineeLoggedIn( bool enabled );
private Q_SLOTS:
void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
public Q_SLOTS:
//слот обработки сигнала об изменении вкладки диалога в мессенджере
void slot_tabMessengerChanged(QString login);
Q_SIGNALS:
//сигнал о выборе обучаемого
void signal_traineeSelected(QString login);
private:
Ui::ViewerTrainees *ui;
};
#endif // TRAINEESWIDGET_H

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ViewerTrainees</class>
<widget class="QWidget" name="ViewerTrainees">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="font">
<font>
<family>Tahoma</family>
</font>
</property>
<property name="windowTitle">
<string>Trainees</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTreeWidget" name="treeWidget">
<property name="font">
<font>
<family>Tahoma</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="columnCount">
<number>1</number>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>