From 17f18f4135a99c089276dbe08887e6b57bf21fb4 Mon Sep 17 00:00:00 2001 From: shi_jq Date: Thu, 13 Mar 2025 14:19:44 +0800 Subject: [PATCH] =?UTF-8?q?[ref]=E5=90=8C=E6=AD=A5711?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../camera_statistics/camera_statistics.pro | 5 ++- .../camera_statistics/ccameraorientation.cpp | 7 ++-- .../camera_statistics/ccameraorientation.h | 4 +-- product/src/tools/camera_statistics/main.cpp | 33 +++++++++++++++++- .../resource/preset_config.ico | Bin 4286 -> 4286 bytes 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/product/src/tools/camera_statistics/camera_statistics.pro b/product/src/tools/camera_statistics/camera_statistics.pro index 5e0d4902..27442832 100644 --- a/product/src/tools/camera_statistics/camera_statistics.pro +++ b/product/src/tools/camera_statistics/camera_statistics.pro @@ -19,6 +19,8 @@ TARGET = camera_statistics # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS +RC_ICONS = resource/preset_config.ico + SOURCES += \ main.cpp \ ccameraorientation.cpp \ @@ -42,6 +44,7 @@ LIBS += -llog4cplus \ -ldb_sysinfo_api \ -lpub_utility_api \ -lOnvifLib \ + -lpub_widget win32-msvc* { @@ -53,7 +56,7 @@ CONFIG(release, debug|release) { } } -linux-g++*{ +linux-*g++*{ LIBS += -lQtAV -lQtAVWidgets -lssl -lcrypto -lXext } diff --git a/product/src/tools/camera_statistics/ccameraorientation.cpp b/product/src/tools/camera_statistics/ccameraorientation.cpp index 37065f06..4fbd5d61 100644 --- a/product/src/tools/camera_statistics/ccameraorientation.cpp +++ b/product/src/tools/camera_statistics/ccameraorientation.cpp @@ -8,11 +8,12 @@ using namespace iot_public; using namespace iot_dbms; using namespace QtAV; - CCameraOrientation::CCameraOrientation(QWidget *parent) : - QDialog(parent), + CustomUiDialog(parent,false), ui(new Ui::CCameraOrientation) { + setWindowTitle(tr("摄像头预置点配置")); + ui->setupUi(this); QtAV::setLogLevel(QtAV::LogAll); // 关闭qtav的日志 @@ -21,6 +22,8 @@ CCameraOrientation::CCameraOrientation(QWidget *parent) : initDb(); initUi(); initConnect(); + + setAutoLayout(true); } CCameraOrientation::~CCameraOrientation() diff --git a/product/src/tools/camera_statistics/ccameraorientation.h b/product/src/tools/camera_statistics/ccameraorientation.h index a379d29e..8505c725 100644 --- a/product/src/tools/camera_statistics/ccameraorientation.h +++ b/product/src/tools/camera_statistics/ccameraorientation.h @@ -1,9 +1,9 @@ #ifndef CCAMERAORIENTATION_H #define CCAMERAORIENTATION_H -#include #include #include "db_api_ex/CDbApi.h" +#include "pub_widget/CustomDialog.h" #include "pub_logger_api/logger.h" #include "scamera.h" @@ -20,7 +20,7 @@ namespace Ui { class CCameraOrientation; } -class CCameraOrientation : public QDialog +class CCameraOrientation : public CustomUiDialog { Q_OBJECT diff --git a/product/src/tools/camera_statistics/main.cpp b/product/src/tools/camera_statistics/main.cpp index 5775b38d..b4b9bf81 100644 --- a/product/src/tools/camera_statistics/main.cpp +++ b/product/src/tools/camera_statistics/main.cpp @@ -4,6 +4,35 @@ #include "common/QtAppGlobalSet.h" #include "pub_logger_api/logger.h" #include "ccameraorientation.h" +#include "pub_utility_api/FileStyle.h" + +void loadStyle() +{ + QString qss = QString(); + std::string strFullPath = iot_public::CFileStyle::getPathOfStyleFile("public.qss","zh","light"); + + QFile qssfile1(QString::fromStdString(strFullPath)); + qssfile1.open(QFile::ReadOnly); + if (qssfile1.isOpen()) + { + qss += QLatin1String(qssfile1.readAll()); + qssfile1.close(); + } + + strFullPath = iot_public::CFileStyle::getPathOfStyleFile("camera_statistics.qss","zh","light"); + QFile qssfile2(QString::fromStdString(strFullPath)); + qssfile2.open(QFile::ReadOnly); + if (qssfile2.isOpen()) + { + qss += QLatin1String(qssfile2.readAll()); + qssfile2.close(); + } + + if (!qss.isEmpty()) + { + qApp->setStyleSheet(qss); + } +} int main(int argc, char *argv[]) { @@ -13,8 +42,10 @@ int main(int argc, char *argv[]) qputenv("QT_ANGLE_PLATFORM", "d3d11"); QApplication a(argc, argv); + loadStyle(); + a.setWindowIcon(QIcon(":/resource/preset_config.ico")); - iot_public::StartLogSystem("PSCADA","camera_statistics"); + iot_public::StartLogSystem("tools","camera_statistics"); CCameraOrientation w( 0 ); w.show(); diff --git a/product/src/tools/camera_statistics/resource/preset_config.ico b/product/src/tools/camera_statistics/resource/preset_config.ico index b54565c8ef96c32c2dc07c16027b8cbef08b04c8..f3e9bf1bd78af8c0f4614fb17d8f5fbe4106bedc 100644 GIT binary patch literal 4286 zcmeHJzl#$=6#o2C2nu&_qJ_c*uF%fX^6V@uEG;aq@DE5~d4&s`J?$+lEK=Cm`6ooM zu!s;O*{l-K!qP&);tmw!_l=n__n4h*FoIwbUf#U#&AjiuH?xxkPVn1mLBDvu30weh zl|l$ND8lv0=-WE`TO6?dS$E(c?m#cYnPGwUsDu8ngYVSSCFGEE2W5`?inDB);|{jT zSuMer%B@nora8E}SI6!1s+#seJzG)Tp4;hRj&_qCXy20j1#Z&cOU{X(m3~8hotL4R_OQ|n`V7E7)FQ=jFE*=2zje@kL~ z7JJWgWkqMM%y8})-od5n09zItWY`QbKAWfC<+viua>eYL`(uy2e;D?k+`GJYpM}`C zz%ANOJ;qqCIcLYk%yAgwvl!R*{d%W!e14PRyt(7uJB7)0qIshn--7jF-UG`Ovspts zSU=@ictGxZA;$5Z@DS5`1K-#7=U9$UVczn`_$;QolrbvBQGMEDj_3cg>Vx(;?1#p# z_TU~gc{hIlQ9g{{n&r^dJ}Vb5v%1ySImYp0{`cJVnDSPRw3TKv6d)}t*PKb^9&ZRhuxYqvvvjfw}=O?iH1K2(SHs*4Y<5QBC Ul&>?LZ5#;?=hciAPjM~XFCo2i6#xJL literal 4286 zcmeI0X;78t702IhNoVRzGquadrk~oco#{-(C@v%_BB+qXHEJM&3$jEaN(34(9-sqnNLtps*7MTM6WDizjF6EOOqQNzSG?vMXZA zE(gQL>11yJNAXm$3#S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