diff --git a/CMakeLists.txt b/CMakeLists.txt index b29a9e4..361c446 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,9 @@ if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) MANUAL_FINALIZATION ${PROJECT_SOURCES} resources.qrc - form.ui + sensorwidget.h sensorwidget.cpp + sensorlayout.h sensorlayout.cpp + ) # Define target properties for Android with Qt 6 as: # set_property(TARGET FemaSoftware APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user index cb3d885..4fe07c6 100644 --- a/CMakeLists.txt.user +++ b/CMakeLists.txt.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -102,14 +102,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=Debug + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} 0 D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_5_3_MinGW_64_bit-Debug @@ -159,14 +159,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=Release + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_5_3_MinGW_64_bit-Release @@ -213,14 +213,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_5_3_MinGW_64_bit-RelWithDebInfo @@ -267,14 +267,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} 0 D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_5_3_MinGW_64_bit-Profile @@ -322,14 +322,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=MinSizeRel + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=MinSizeRel +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_5_3_MinGW_64_bit-MinSizeRel @@ -422,14 +422,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=Debug + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} 0 D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_8_0_MinGW_64_bit-Debug @@ -477,14 +477,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=Release + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_8_0_MinGW_64_bit-Release @@ -531,14 +531,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_8_0_MinGW_64_bit-RelWithDebInfo @@ -585,14 +585,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} 0 D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_8_0_MinGW_64_bit-Profile @@ -640,14 +640,14 @@ 2 false - -DCMAKE_BUILD_TYPE:STRING=MinSizeRel + -DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} -DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx} --DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} --DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG} --DCMAKE_GENERATOR:STRING=Ninja -DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable} -DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX} --DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_GENERATOR:STRING=Ninja +-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake +-DCMAKE_BUILD_TYPE:STRING=MinSizeRel +-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C} D:\Projects\QTProjects\FemaSoftware\build\Desktop_Qt_6_8_0_MinGW_64_bit-MinSizeRel diff --git a/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware.exe b/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware.exe index 888e1fa..8c83869 100644 Binary files a/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware.exe and b/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware.exe differ diff --git a/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/include/ui_mainwindow.h b/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/include/ui_mainwindow.h index 174dbe2..35f7905 100644 --- a/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/include/ui_mainwindow.h +++ b/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/include/ui_mainwindow.h @@ -14,11 +14,12 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include @@ -31,23 +32,19 @@ public: QGridLayout *gridLayout_4; QTabWidget *tabWidget; QWidget *sensorsTab; - QVBoxLayout *verticalLayout; - QVBoxLayout *verticalLayout_2; - QSpacerItem *verticalSpacer; - QHBoxLayout *horizontalLayout_2; + QVBoxLayout *SensorsTabLayout; + QHBoxLayout *nameLayout; + QLabel *group; + QLabel *showHidden; QSpacerItem *horizontalSpacer; - QComboBox *comboBox; + QHBoxLayout *selectLayout; + QComboBox *showHiddenSelect; + QComboBox *groupSelect; QSpacerItem *horizontalSpacer_2; - QComboBox *comboBox_2; + QHBoxLayout *searchLayout; + QLineEdit *search; QSpacerItem *horizontalSpacer_3; - QSpacerItem *verticalSpacer_4; - QHBoxLayout *horizontalLayout_3; - QSpacerItem *horizontalSpacer_5; - QTextEdit *textEdit; - QSpacerItem *horizontalSpacer_4; - QSpacerItem *verticalSpacer_2; - QHBoxLayout *horizontalLayout; - QSpacerItem *verticalSpacer_3; + QVBoxLayout *sensorsLayout; QWidget *incidentsTab; QGridLayout *gridLayout_8; QWidget *journalTab; @@ -62,7 +59,7 @@ public: { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName("MainWindow"); - MainWindow->resize(1405, 867); + MainWindow->resize(1632, 896); QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); @@ -71,13 +68,15 @@ public: MainWindow->setMinimumSize(QSize(1150, 750)); MainWindow->setMaximumSize(QSize(16777215, 16777215)); MainWindow->setBaseSize(QSize(0, 0)); - MainWindow->setStyleSheet(QString::fromUtf8(" margin: 0; \n" -" padding: 0;")); + MainWindow->setStyleSheet(QString::fromUtf8("")); MainWindow->setTabShape(QTabWidget::TabShape::Rounded); centralwidget = new QWidget(MainWindow); centralwidget->setObjectName("centralwidget"); centralwidget->setAutoFillBackground(false); - centralwidget->setStyleSheet(QString::fromUtf8("background: #dcd174;")); + centralwidget->setStyleSheet(QString::fromUtf8("QWidget{\n" +"background: #dcd174;\n" +"}\n" +"")); gridLayout_4 = new QGridLayout(centralwidget); gridLayout_4->setSpacing(0); gridLayout_4->setObjectName("gridLayout_4"); @@ -90,7 +89,6 @@ public: " background: #dcd174;\n" " width: 222px;\n" " height: 44px;\n" -" gap: 0px;\n" " opacity: 0px;\n" " border: 1px solid #dcd174; \n" " padding: 18px 0px;\n" @@ -101,8 +99,6 @@ public: " font-weight: 500;\n" " line-height: 43.57px;\n" " text-align: left;\n" -" text-underline-position: from-font;\n" -" text-decoration-skip-ink: none;\n" "}\n" "\n" "QTabBar::tab:selected {\n" @@ -111,8 +107,6 @@ public: " font-weight: 900;\n" " line-height: 43.57px;\n" " text-align: left;\n" -" text-underline-position: from-font;\n" -" text-decoration-skip-ink: none;\n" "}\n" "\n" "QTabBar::pane { \n" @@ -131,96 +125,153 @@ public: " background-color: #ffffff; \n" " image-position: bottom right;\n" "}")); - verticalLayout = new QVBoxLayout(sensorsTab); - verticalLayout->setObjectName("verticalLayout"); - verticalLayout_2 = new QVBoxLayout(); - verticalLayout_2->setObjectName("verticalLayout_2"); - verticalSpacer = new QSpacerItem(20, 25, QSizePolicy::Policy::Fixed, QSizePolicy::Minimum); - - verticalLayout_2->addItem(verticalSpacer); - - horizontalLayout_2 = new QHBoxLayout(); - horizontalLayout_2->setSpacing(0); - horizontalLayout_2->setObjectName("horizontalLayout_2"); - horizontalSpacer = new QSpacerItem(15, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Minimum); - - horizontalLayout_2->addItem(horizontalSpacer); - - comboBox = new QComboBox(sensorsTab); - comboBox->setObjectName("comboBox"); + SensorsTabLayout = new QVBoxLayout(sensorsTab); + SensorsTabLayout->setSpacing(10); + SensorsTabLayout->setObjectName("SensorsTabLayout"); + SensorsTabLayout->setSizeConstraint(QLayout::SizeConstraint::SetDefaultConstraint); + SensorsTabLayout->setContentsMargins(0, 25, 0, 0); + nameLayout = new QHBoxLayout(); + nameLayout->setSpacing(15); + nameLayout->setObjectName("nameLayout"); + nameLayout->setSizeConstraint(QLayout::SizeConstraint::SetFixedSize); + nameLayout->setContentsMargins(25, -1, -1, -1); + group = new QLabel(sensorsTab); + group->setObjectName("group"); QSizePolicy sizePolicy2(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy2.setHorizontalStretch(0); sizePolicy2.setVerticalStretch(0); - sizePolicy2.setHeightForWidth(comboBox->sizePolicy().hasHeightForWidth()); - comboBox->setSizePolicy(sizePolicy2); - comboBox->setMinimumSize(QSize(488, 60)); - comboBox->setMaximumSize(QSize(488, 60)); + sizePolicy2.setHeightForWidth(group->sizePolicy().hasHeightForWidth()); + group->setSizePolicy(sizePolicy2); + group->setMinimumSize(QSize(488, 36)); + group->setStyleSheet(QString::fromUtf8("width: 488px;\n" +"height: 36px;\n" +"background: transparent;\n" +"font-family: Inter;\n" +"font-size: 30px;\n" +"font-weight: 400;\n" +"line-height: 36.31px;\n" +"text-align: left;\n" +"color: #13385F;\n" +"")); - horizontalLayout_2->addWidget(comboBox); + nameLayout->addWidget(group); - horizontalSpacer_2 = new QSpacerItem(15, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Minimum); + showHidden = new QLabel(sensorsTab); + showHidden->setObjectName("showHidden"); + sizePolicy2.setHeightForWidth(showHidden->sizePolicy().hasHeightForWidth()); + showHidden->setSizePolicy(sizePolicy2); + showHidden->setMinimumSize(QSize(275, 36)); + showHidden->setStyleSheet(QString::fromUtf8("width: 275px;\n" +"height: 36px;\n" +"background: transparent;\n" +"font-family: Inter;\n" +"font-size: 30px;\n" +"font-weight: 400;\n" +"line-height: 36.31px;\n" +"text-align: left;\n" +"color: #13385F;\n" +"")); - horizontalLayout_2->addItem(horizontalSpacer_2); + nameLayout->addWidget(showHidden); - comboBox_2 = new QComboBox(sensorsTab); - comboBox_2->setObjectName("comboBox_2"); - comboBox_2->setEnabled(true); - sizePolicy2.setHeightForWidth(comboBox_2->sizePolicy().hasHeightForWidth()); - comboBox_2->setSizePolicy(sizePolicy2); - comboBox_2->setMinimumSize(QSize(275, 60)); - comboBox_2->setMaximumSize(QSize(275, 60)); + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - horizontalLayout_2->addWidget(comboBox_2); + nameLayout->addItem(horizontalSpacer); + + + SensorsTabLayout->addLayout(nameLayout); + + selectLayout = new QHBoxLayout(); + selectLayout->setSpacing(15); + selectLayout->setObjectName("selectLayout"); + selectLayout->setSizeConstraint(QLayout::SizeConstraint::SetFixedSize); + selectLayout->setContentsMargins(25, -1, -1, 10); + showHiddenSelect = new QComboBox(sensorsTab); + showHiddenSelect->setObjectName("showHiddenSelect"); + sizePolicy2.setHeightForWidth(showHiddenSelect->sizePolicy().hasHeightForWidth()); + showHiddenSelect->setSizePolicy(sizePolicy2); + showHiddenSelect->setMinimumSize(QSize(488, 60)); + showHiddenSelect->setStyleSheet(QString::fromUtf8("QComboBox::drop-down {\n" +" border: 0px;\n" +"}\n" +"\n" +"QComboBox::down-arrow {\n" +" image: url(:/visual/res/svg/chevron-down.png);\n" +"}\n" +"\n" +"QComboBox {\n" +" border: 2px solid #DCD174;\n" +" background: transparent;\n" +"}")); + + selectLayout->addWidget(showHiddenSelect); + + groupSelect = new QComboBox(sensorsTab); + groupSelect->setObjectName("groupSelect"); + sizePolicy2.setHeightForWidth(groupSelect->sizePolicy().hasHeightForWidth()); + groupSelect->setSizePolicy(sizePolicy2); + groupSelect->setMinimumSize(QSize(275, 60)); + groupSelect->setStyleSheet(QString::fromUtf8("QComboBox::drop-down {\n" +" border: 0px;\n" +"}\n" +"\n" +"QComboBox::down-arrow {\n" +" image: url(:/visual/res/svg/chevron-down.png);\n" +"}\n" +"\n" +"QComboBox {\n" +" border: 2px solid #DCD174;\n" +" background: transparent;\n" +"}")); + + selectLayout->addWidget(groupSelect); + + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + selectLayout->addItem(horizontalSpacer_2); + + + SensorsTabLayout->addLayout(selectLayout); + + searchLayout = new QHBoxLayout(); + searchLayout->setSpacing(0); + searchLayout->setObjectName("searchLayout"); + searchLayout->setSizeConstraint(QLayout::SizeConstraint::SetFixedSize); + searchLayout->setContentsMargins(25, -1, -1, 10); + search = new QLineEdit(sensorsTab); + search->setObjectName("search"); + sizePolicy2.setHeightForWidth(search->sizePolicy().hasHeightForWidth()); + search->setSizePolicy(sizePolicy2); + search->setMinimumSize(QSize(778, 60)); + search->setStyleSheet(QString::fromUtf8("width: 778px;\n" +"height: 60px;\n" +"border: 2px solid #DCD174;\n" +"font-family: Inter;\n" +"font-size: 26px;\n" +"font-weight: 400;\n" +"line-height: 31.47px;\n" +"text-align: left;\n" +"background: #00000000;\n" +"color: #a6a6a6;\n" +"\n" +"\n" +"\n" +"")); + + searchLayout->addWidget(search); horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - horizontalLayout_2->addItem(horizontalSpacer_3); + searchLayout->addItem(horizontalSpacer_3); - verticalLayout_2->addLayout(horizontalLayout_2); + SensorsTabLayout->addLayout(searchLayout); - verticalSpacer_4 = new QSpacerItem(20, 15, QSizePolicy::Policy::Fixed, QSizePolicy::Minimum); + sensorsLayout = new QVBoxLayout(); + sensorsLayout->setObjectName("sensorsLayout"); + sensorsLayout->setContentsMargins(25, -1, -1, -1); - verticalLayout_2->addItem(verticalSpacer_4); - - horizontalLayout_3 = new QHBoxLayout(); - horizontalLayout_3->setObjectName("horizontalLayout_3"); - horizontalSpacer_5 = new QSpacerItem(15, 20, QSizePolicy::Policy::Fixed, QSizePolicy::Minimum); - - horizontalLayout_3->addItem(horizontalSpacer_5); - - textEdit = new QTextEdit(sensorsTab); - textEdit->setObjectName("textEdit"); - sizePolicy2.setHeightForWidth(textEdit->sizePolicy().hasHeightForWidth()); - textEdit->setSizePolicy(sizePolicy2); - textEdit->setMinimumSize(QSize(778, 60)); - textEdit->setMaximumSize(QSize(778, 60)); - - horizontalLayout_3->addWidget(textEdit); - - horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); - - horizontalLayout_3->addItem(horizontalSpacer_4); - - - verticalLayout_2->addLayout(horizontalLayout_3); - - - verticalLayout->addLayout(verticalLayout_2); - - verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Expanding, QSizePolicy::Minimum); - - verticalLayout->addItem(verticalSpacer_2); - - horizontalLayout = new QHBoxLayout(); - horizontalLayout->setSpacing(0); - horizontalLayout->setObjectName("horizontalLayout"); - verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Policy::Maximum, QSizePolicy::Minimum); - - horizontalLayout->addItem(verticalSpacer_3); - - - verticalLayout->addLayout(horizontalLayout); + SensorsTabLayout->addLayout(sensorsLayout); tabWidget->addTab(sensorsTab, QString()); incidentsTab = new QWidget(); @@ -281,7 +332,7 @@ public: retranslateUi(MainWindow); - tabWidget->setCurrentIndex(1); + tabWidget->setCurrentIndex(0); QMetaObject::connectSlotsByName(MainWindow); @@ -290,7 +341,9 @@ public: void retranslateUi(QMainWindow *MainWindow) { MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "FemaLocal", nullptr)); - comboBox->setCurrentText(QString()); + group->setText(QCoreApplication::translate("MainWindow", "\320\223\321\200\321\203\320\277\320\277\320\260:", nullptr)); + showHidden->setText(QCoreApplication::translate("MainWindow", "\320\237\320\276\320\272\320\260\320\267\320\260\321\202\321\214 \321\201\320\272\321\200\321\213\321\202\321\213\320\265", nullptr)); + search->setText(QCoreApplication::translate("MainWindow", "\320\237\320\276\320\270\321\201\320\272...", nullptr)); tabWidget->setTabText(tabWidget->indexOf(sensorsTab), QCoreApplication::translate("MainWindow", "\320\224\320\260\321\202\321\207\320\270\320\272\320\270", nullptr)); tabWidget->setTabText(tabWidget->indexOf(incidentsTab), QCoreApplication::translate("MainWindow", "\320\230\320\275\321\206\320\270\320\264\320\265\320\275\321\202\321\213", nullptr)); tabWidget->setTabText(tabWidget->indexOf(journalTab), QCoreApplication::translate("MainWindow", "\320\226\321\203\321\200\320\275\320\260\320\273", nullptr)); diff --git a/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/mocs_compilation.cpp b/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/mocs_compilation.cpp index de9bec6..9210d63 100644 --- a/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/mocs_compilation.cpp +++ b/build/Desktop_Qt_6_5_3_MinGW_64_bit-Debug/FemaSoftware_autogen/mocs_compilation.cpp @@ -1,2 +1,3 @@ // This file is autogenerated. Changes will be overwritten. #include "EWIEGA46WW/moc_mainwindow.cpp" +#include "EWIEGA46WW/moc_sensorwidget.cpp" diff --git a/form.ui b/form.ui deleted file mode 100644 index cf7cafd..0000000 --- a/form.ui +++ /dev/null @@ -1,193 +0,0 @@ - - - Form - - - - 0 - 0 - 1537 - 859 - - - - Form - - - - - 230 - 220 - 778 - 98 - - - - - QLayout::SizeConstraint::SetNoConstraint - - - 0 - - - - - - 0 - 0 - - - - - 275 - 60 - - - - QComboBox::drop-down { - border: 0px; -} - -QComboBox::down-arrow { - image: url(:/visual/res/svg/chevron-down.png); -} - -QComboBox { - border: 2px solid #DCD174; - background: transparent; -} - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Ignored - - - - 15 - 20 - - - - - - - - - 0 - 0 - - - - - 488 - 60 - - - - - 488 - 60 - - - - QComboBox::drop-down { - border: 0px; -} - -QComboBox::down-arrow { - image: url(:/visual/res/svg/chevron-down.png); -} - -QComboBox { - border: 2px solid #DCD174; - background: transparent; -} - - - - - - - - 0 - 0 - - - - - 111 - 36 - - - - - 111 - 36 - - - - font-family: Inter; -font-size: 30px; -font-weight: 400; -line-height: 36.31px; -text-align: left; -text-underline-position: from-font; -text-decoration-skip-ink: none; -color: #13385F; -background: transparent; - - - - Группа: - - - - - - - - 0 - 0 - - - - - 274 - 36 - - - - - 274 - 36 - - - - font-family: Inter; -font-size: 30px; -font-weight: 400; -line-height: 36.31px; -text-align: left; -text-underline-position: from-font; -text-decoration-skip-ink: none; -color: #13385F; -background: transparent; - - - - Показать скрытые - - - - - - - - - diff --git a/mainwindow.cpp b/mainwindow.cpp index 20d26ab..274a3c2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,17 +1,51 @@ #include "mainwindow.h" #include "./ui_mainwindow.h" +#include "sensorwidget.h" +#include "sensorlayout.h" #include #include #include +#include + +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); + + // Создаем QScrollArea для прокрутки + QScrollArea* scrollArea = new QScrollArea(this); + scrollArea->setStyleSheet("background: transparent; border: 0;"); + SensorLayout* sl = new SensorLayout(scrollArea); + scrollArea->setLayout(sl); // Устанавливаем контейнер + scrollArea->setWidgetResizable(true); // Контейнер будет растягиваться по области просмотра + scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + + // Добавляем QScrollArea в основной layout + ui->SensorsTabLayout->addWidget(scrollArea); + + // Добавляем виджеты в SensorLayout + int rows = 0; // Количество строк + int columns = 0; // Количество столбцов + + for (int row = 0; row < rows; ++row) { + for (int col = 0; col < columns; ++col) { + const QString a = QString::number(row); + const QString b = QString::number(col); + const QString c = QString::number(row + col); + SensorWidget* sensor = new SensorWidget(nullptr, a, b, c); + sl->addWidget(sensor); + } + } + } + + MainWindow::~MainWindow() { delete ui; diff --git a/mainwindow.ui b/mainwindow.ui index 8d04b36..880bbc1 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 1405 - 867 + 1632 + 896 @@ -38,8 +38,7 @@ FemaLocal - margin: 0; - padding: 0; + QTabWidget::TabShape::Rounded @@ -49,7 +48,10 @@ false - background: #dcd174; + QWidget{ +background: #dcd174; +} + @@ -83,7 +85,6 @@ background: #dcd174; width: 222px; height: 44px; - gap: 0px; opacity: 0px; border: 1px solid #dcd174; padding: 18px 0px; @@ -94,8 +95,6 @@ font-weight: 500; line-height: 43.57px; text-align: left; - text-underline-position: from-font; - text-decoration-skip-ink: none; } QTabBar::tab:selected { @@ -104,8 +103,6 @@ QTabBar::tab:selected { font-weight: 900; line-height: 43.57px; text-align: left; - text-underline-position: from-font; - text-decoration-skip-ink: none; } QTabBar::pane { @@ -113,7 +110,7 @@ border-image: url(:/visual/res/svg/fema-wing.svg); } - 1 + 0 @@ -138,236 +135,273 @@ border-image: url(:/visual/res/svg/fema-wing.svg); Датчики - + + + 10 + + + QLayout::SizeConstraint::SetDefaultConstraint + + + 0 + + + 25 + + + 0 + + + 0 + - + + + 15 + + + QLayout::SizeConstraint::SetFixedSize + + + 25 + - - - Qt::Orientation::Vertical + + + + 0 + 0 + - - QSizePolicy::Policy::Fixed + + + 488 + 36 + + + + width: 488px; +height: 36px; +background: transparent; +font-family: Inter; +font-size: 30px; +font-weight: 400; +line-height: 36.31px; +text-align: left; +color: #13385F; + + + + Группа: + + + + + + + + 0 + 0 + + + + + 275 + 36 + + + + width: 275px; +height: 36px; +background: transparent; +font-family: Inter; +font-size: 30px; +font-weight: 400; +line-height: 36.31px; +text-align: left; +color: #13385F; + + + + Показать скрытые + + + + + + + Qt::Orientation::Horizontal - 20 - 25 + 40 + 20 - - - - 0 - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 15 - 20 - - - - - - - - - 0 - 0 - - - - - 488 - 60 - - - - - 488 - 60 - - - - - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 15 - 20 - - - - - - - - true - - - - 0 - 0 - - - - - 275 - 60 - - - - - 275 - 60 - - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Orientation::Vertical - - - QSizePolicy::Policy::Fixed - - - - 20 - 15 - - - - - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 15 - 20 - - - - - - - - - 0 - 0 - - - - - 778 - 60 - - - - - 778 - 60 - - - - - - - - Qt::Orientation::Horizontal - - - - 40 - 20 - - - - - - - - - Qt::Orientation::Vertical - - - - 20 - 40 - - - - - - + - 0 + 15 + + + QLayout::SizeConstraint::SetFixedSize + + + 25 + + + 10 - - - Qt::Orientation::Vertical + + + + 0 + 0 + - - QSizePolicy::Policy::Maximum + + + 488 + 60 + + + + QComboBox::drop-down { + border: 0px; +} + +QComboBox::down-arrow { + image: url(:/visual/res/svg/chevron-down.png); +} + +QComboBox { + border: 2px solid #DCD174; + background: transparent; +} + + + + + + + + 0 + 0 + + + + + 275 + 60 + + + + QComboBox::drop-down { + border: 0px; +} + +QComboBox::down-arrow { + image: url(:/visual/res/svg/chevron-down.png); +} + +QComboBox { + border: 2px solid #DCD174; + background: transparent; +} + + + + + + + Qt::Orientation::Horizontal - 20 - 40 + 40 + 20 + + + + 0 + + + QLayout::SizeConstraint::SetFixedSize + + + 25 + + + 10 + + + + + + 0 + 0 + + + + + 778 + 60 + + + + width: 778px; +height: 60px; +border: 2px solid #DCD174; +font-family: Inter; +font-size: 26px; +font-weight: 400; +line-height: 31.47px; +text-align: left; +background: #00000000; +color: #a6a6a6; + + + + + + + Поиск... + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + + + + + + + 25 + + + diff --git a/sensorlayout.cpp b/sensorlayout.cpp new file mode 100644 index 0000000..d3c18f0 --- /dev/null +++ b/sensorlayout.cpp @@ -0,0 +1,75 @@ +#include "sensorlayout.h" + +SensorLayout::SensorLayout(QWidget *parent) + : QLayout(parent) +{ +} + +SensorLayout::~SensorLayout() +{ + while (!items.isEmpty()) + delete items.takeFirst(); +} + +void SensorLayout::addItem(QLayoutItem *item) +{ + items.append(item); +} + +QSize SensorLayout::sizeHint() const +{ + return QSize(400, 400); // Базовый размер +} + +QSize SensorLayout::minimumSize() const +{ + return QSize(200, 200); // Минимальный размер +} + +int SensorLayout::count() const +{ + return items.size(); +} + +QLayoutItem* SensorLayout::itemAt(int index) const +{ + return items.value(index); +} + +QLayoutItem* SensorLayout::takeAt(int index) +{ + if (index >= 0 && index < items.size()) + return items.takeAt(index); + return nullptr; +} + +void SensorLayout::setGeometry(const QRect &rect) +{ + QLayout::setGeometry(rect); + + int x = spacing; // Отступ слева + int y = spacing; // Отступ сверху + int maxWidth = rect.width(); // Максимальная ширина доступного пространства + int rowHeight = 0; // Высота текущей строки + + for (QLayoutItem *item : qAsConst(items)) { + QSize itemSize = item->sizeHint(); + + // Проверяем, помещается ли элемент в текущую строку + if (x + itemSize.width() > maxWidth - spacing) { + // Переход на новую строку + x = spacing; // Сбрасываем горизонтальное положение + y += rowHeight + spacing; // Увеличиваем вертикальное положение + rowHeight = 0; // Сбрасываем высоту строки + } + + // Устанавливаем элемент + item->setGeometry(QRect(QPoint(x, y), itemSize)); + + // Обновляем `x` для следующего элемента + x += itemSize.width() + spacing; + + // Высота строки обновляется, если текущий элемент выше + rowHeight = qMax(rowHeight, itemSize.height()); + } +} diff --git a/sensorlayout.h b/sensorlayout.h new file mode 100644 index 0000000..0388236 --- /dev/null +++ b/sensorlayout.h @@ -0,0 +1,27 @@ +#ifndef SENSORLAYOUT_H +#define SENSORLAYOUT_H + +#include +#include +#include + +class SensorLayout : public QLayout +{ +public: + SensorLayout(QWidget *parent = nullptr); + ~SensorLayout(); + + void addItem(QLayoutItem *item) override; + QSize sizeHint() const override; + QSize minimumSize() const override; + int count() const override; + QLayoutItem* itemAt(int index) const override; + QLayoutItem* takeAt(int index) override; + void setGeometry(const QRect &rect) override; +private: + QList items; + int spacing = 20; +}; + +#endif // SENSORLAYOUT_H + diff --git a/sensorwidget.cpp b/sensorwidget.cpp new file mode 100644 index 0000000..2bb2397 --- /dev/null +++ b/sensorwidget.cpp @@ -0,0 +1,130 @@ +#include "sensorwidget.h" +#include + +SensorWidget::SensorWidget(QWidget *parent, + const QString &title, + const QString &value, + const QString &incident) + : QFrame(parent), titleLabel(new QLabel(this)), valueLabel(new QLabel(this)), incidentLabel(new QLabel(this)), layout(new QVBoxLayout(this)) +{ + setFrameStyle(QFrame::Box); + setLineWidth(1); + setStyleSheet("QFrame { border: 2px solid rgba(229, 231, 235, 0.70);; border-radius: 10px; background: rgba(255, 255, 255, 0.70)}"); + + setFixedSize(250, 200); + + layout->addWidget(titleLabel); + + layout->addSpacerItem(new QSpacerItem(1, 55, QSizePolicy::Fixed, QSizePolicy::Fixed)); + + layout->addWidget(valueLabel); + layout->addWidget(incidentLabel); + + // Стиль для нормального состояния + titleLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #13385F;" + "border: 0;" + "background: transparent;"); + valueLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #13385F;" + "border: 0;" + "background: transparent;"); + incidentLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: rgba(19, 56, 95, 0.5);" + "border: 0;" + "background: transparent;"); + + titleLabel->setText(title); + valueLabel->setText(value); + incidentLabel->setText(incident); + + layout->setContentsMargins(10, 10, 10, 10); // Внутренние отступы + layout->setSpacing(5); // Отступы между текстами (кроме спейсеров) + + setLayout(layout); +} + +void SensorWidget::setErrorState(bool hasError, + const QString &title, + const QString &value, + const QString &incident) +{ + // Включение ошибки + if (hasError) { + // Изменение текста и стиля для отображения ошибки + setStyleSheet("QFrame { border: 2px solid #FF453A; border-radius: 10px; background: rgba(255, 69, 58, 0.25);}"); + + titleLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #13385F;" + "border: 0;" + "background: transparent;"); + + valueLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #FF453A;" + "border: 0;" + "background: transparent;"); + + incidentLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #13385F;" + "border: 0;" + "background: transparent;"); + } else { + // Восстановление нормального состояния + setStyleSheet("QFrame { border: 2px solid rgba(229, 231, 235, 0.70);; border-radius: 10px; background: transparent}"); + + titleLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #13385F;" + "border: 0;" + "background: transparent;"); + + valueLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: #13385F;" + "border: 0;" + "background: transparent;"); + + incidentLabel->setStyleSheet("font-family: Inter;" + "font-size: 24px;" + "font-weight: 400;" + "line-height: 29.05px;" + "text-align: left;" + "color: rgba(19, 56, 95, 0.5);" + "border: 0;" + "background: transparent;"); + } + + titleLabel->setText(title); + valueLabel->setText(value); + incidentLabel->setText(incident); +} diff --git a/sensorwidget.h b/sensorwidget.h new file mode 100644 index 0000000..3b385e4 --- /dev/null +++ b/sensorwidget.h @@ -0,0 +1,32 @@ +#ifndef SENSORWIDGET_H +#define SENSORWIDGET_H + +#include +#include +#include + +class SensorWidget : public QFrame +{ + Q_OBJECT + +public: + //Конструктор + explicit SensorWidget(QWidget *parent = nullptr, + const QString &title = "Default sensor", + const QString &value = "1.01 #", + const QString &incident = "Default incident"); + + // Метод для изменения внешнего вида при ошибке + void setErrorState(bool hasError, + const QString &title = "Default error", + const QString &value = "Default error", + const QString &incident = "123 - 123"); + +private: + QLabel *titleLabel; + QLabel *valueLabel; + QLabel *incidentLabel; + QVBoxLayout *layout; +}; + +#endif // SENSORWIDGET_H