From 3b6d78f8c04034b3e946fd1a845b2915e9317f40 Mon Sep 17 00:00:00 2001 From: kazimierczak-robert Date: Fri, 19 Jan 2018 01:54:07 +0100 Subject: [PATCH] =?UTF-8?q?Dodanie=20link=C3=B3w,=20update=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LeonCam/DataBase.cpp | 1 + LeonCam/GeneratedFiles/ui_MainApp.h | 1 + LeonCam/MainApp.cpp | 3 +++ LeonCam/MainApp.h | 3 +-- LeonCam/MainApp.ui | 1 + LeonCam/MainAppCamera.cpp | 2 ++ LeonCam/UserCamera.cpp | 2 ++ README.md | 5 +++++ 8 files changed, 16 insertions(+), 2 deletions(-) diff --git a/LeonCam/DataBase.cpp b/LeonCam/DataBase.cpp index d62949d..5ead118 100644 --- a/LeonCam/DataBase.cpp +++ b/LeonCam/DataBase.cpp @@ -78,6 +78,7 @@ bool DataBase::CreateAlertsDeleteSettings() if (queryResult == 0 && result==true) { query.clear(); + //https://stackoverflow.com/a/25736288 query.exec("BEGIN IMMEDIATE TRANSACTION"); query.prepare("INSERT INTO AlertsDeleteSettings (Date) VALUES (?)"); QVariantList times; diff --git a/LeonCam/GeneratedFiles/ui_MainApp.h b/LeonCam/GeneratedFiles/ui_MainApp.h index afbb003..e2a202d 100644 --- a/LeonCam/GeneratedFiles/ui_MainApp.h +++ b/LeonCam/GeneratedFiles/ui_MainApp.h @@ -164,6 +164,7 @@ class Ui_MainApp "left: 342px;\n" "}\n" "\n" +"/*https://stackoverflow.com/a/26159728*/\n" "QTabBar::tab {\n" "background-color: transparent;\n" "color: rgb(133, 196, 255);\n" diff --git a/LeonCam/MainApp.cpp b/LeonCam/MainApp.cpp index 1d292c0..41dd713 100644 --- a/LeonCam/MainApp.cpp +++ b/LeonCam/MainApp.cpp @@ -452,6 +452,7 @@ void MainApp::UpdateThumbnail(const QPixmap& pixmap, int cameraID) { if (getCameraIDFromLayout(vectorCameraLayoutsPages->at(i)->at(j)) == cameraID) { + //https://stackoverflow.com/a/12799623 ((QPushButton*)vectorCameraLayoutsPages->at(i)->at(j)->itemAtPosition(0, 0)->widget())->setIcon(QIcon(pixmap)); return; } @@ -674,6 +675,7 @@ void MainApp::DeleteCameraFromMemory(QGridLayout* layout) int number = ui.LTotalNumber->text().split(" ").last().toInt(); ui.LTotalNumber->setText("Total number of cameras: " + QVariant(number - 1).toString()); + //https://stackoverflow.com/a/7569928 //Removing all item in layout QLayoutItem * itemLayout; QWidget * widget; @@ -690,6 +692,7 @@ void MainApp::DeleteCameraFromMemory(QGridLayout* layout) } } + //https://stackoverflow.com/a/3385251 item->erase(std::remove(item->begin(), item->end(), layout), item->end()); delete layout; diff --git a/LeonCam/MainApp.h b/LeonCam/MainApp.h index d77e05a..79633c4 100644 --- a/LeonCam/MainApp.h +++ b/LeonCam/MainApp.h @@ -8,7 +8,6 @@ #include "CameraPreview.h" #include "UserCamera.h" #include "CameraEdition.h" -#include #include #include #include @@ -25,7 +24,6 @@ #include #include #include -#include #include using namespace QtCharts; @@ -72,6 +70,7 @@ private slots: void ChangeSecurityQuestion(); public slots: void OpenCameraEdit(int cameraID); + //https://stackoverflow.com/a/8701986 void UpdateThumbnail(const QPixmap& pixmap, int cameraID); void InsertGreenAlert(int greenAlertID, int faceID, int cameraID, QString dateTimeNow); void InsertRedAlert(int redAlertID, int cameraID, QString dateTimeNow); diff --git a/LeonCam/MainApp.ui b/LeonCam/MainApp.ui index 302bff3..11746f2 100644 --- a/LeonCam/MainApp.ui +++ b/LeonCam/MainApp.ui @@ -166,6 +166,7 @@ QTabWidget::tab-bar { left: 342px; } +/*https://stackoverflow.com/a/26159728*/ QTabBar::tab { background-color: transparent; color: rgb(133, 196, 255); diff --git a/LeonCam/MainAppCamera.cpp b/LeonCam/MainAppCamera.cpp index 2938e1e..70a5549 100644 --- a/LeonCam/MainAppCamera.cpp +++ b/LeonCam/MainAppCamera.cpp @@ -81,6 +81,7 @@ void MainAppCamera::UpdateDBAfterPrediction(int predictionLabel) filePath = filePath + "\\" + QVariant(query.value(0).toInt()).toString() + ".avi"; //the last parameter: color or not video //CV_FOURCC('M', 'J', 'P', 'G') + //https://stackoverflow.com/a/24197540 videowriter.open(filePath.toStdString(), CV_FOURCC('X','2','6','4'), (double)cameraFPS/updateImagePeriod, cv::Size(640, 360), true); } else @@ -430,6 +431,7 @@ void MainAppCamera::Process() //There is an alert add red border if (redAlert->redAlertID != -1) { + //http://www.qtcentre.org/threads/52964-Draw-rectangle-on-QImage?s=e283053d55d3b36ab4616fb2051808c3&p=237304#post237304 qPainter.begin(&pixmapWithRedBorder); qPainter.setBrush(Qt::NoBrush); qPainter.setPen(pen); diff --git a/LeonCam/UserCamera.cpp b/LeonCam/UserCamera.cpp index 74149d1..3821df0 100644 --- a/LeonCam/UserCamera.cpp +++ b/LeonCam/UserCamera.cpp @@ -4,6 +4,7 @@ UserCamera::UserCamera(QWidget *parent, int userID) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint) { ui.setupUi(this); + //https://stackoverflow.com/a/18275148 ui.CBAvailableCameras->lineEdit()->setPlaceholderText("IPv4 address:port number"); this->setResult(QDialog::Rejected); //Create DesignB instance @@ -28,6 +29,7 @@ UserCamera::~UserCamera() watcher->waitForFinished(); } } +//https://github.com/Lycycz/onvif_device/blob/master/onvif.cpp std::string UserCamera::GenerateUuid() { const int kGUIDSize = 39; diff --git a/README.md b/README.md index 2cf04b7..df1ad2c 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,9 @@ Supervisor: dr Anna Grocholewska-CzuryƂo Attributions ------------ - http://doc.qt.io/qt-5.9/index.html +- https://github.com/linkingvision/rapidonvif/tree/onvifcpplib +- https://github.com/peters/opencv.ffmpeg +- https://github.com/Lycycz/onvif_device/blob/master/onvif.cpp - https://asmaloney.com/2013/11/code/converting-between-cvmat-and-qimage-or-qpixmap - http://develnoter.blogspot.com/2012/05/integrating-opencv-in-qt-gui.html - http://www.qtcentre.org/threads/3416-Center-a-widget-in-a-cell-on-a-QTableWidget @@ -70,3 +73,5 @@ Attributions - https://pixabay.com/ - https://stackoverflow.com/ (hyperlinks in the source code) - https://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption +- http://www.qtcentre.org/threads/52964-Draw-rectangle-on-QImage?s=e283053d55d3b36ab4616fb2051808c3&p=237304#post237304 +- https://github.com/therecipe/qt/wiki/Setting-the-Application-Icon \ No newline at end of file