12 changed files with 164 additions and 60 deletions
-
5.gitignore
-
10Projects/QT-Gui-App/Win32-QT-gui-application_2019.vcxproj
-
24lib/App/3dGUI/main-qt.cpp
-
59lib/components/object/objectEventReport.cpp
-
38lib/components/object/objectEventReport.h
-
8lib/data/media/video/videoAVLIBSource.cpp
-
21lib/data/net/clientPort.cpp
-
9lib/data/storage/storageProvider.cpp
-
1lib/data/storage/storageProvider.h
-
2lib/gui/controls/EventViewWidget.cpp
-
37lib/gui/controls/ReportsManagerWindow.cpp
-
10lib/gui/controls/ReportsManagerWindow.h
@ -1,11 +1,44 @@ |
|||
#include "ReportsManagerWindow.h"
|
|||
|
|||
guiReportsManagerWindow::guiReportsManagerWindow(QDialog *parent) : QDialog(parent){ |
|||
m_pCalendarWidget = new QCalendarWidget(); |
|||
m_pCalendarWidget = new QCalendarWidget( this ); |
|||
m_pSystemReport = objectEventReport::getInstance(); |
|||
m_pCalendarWidget->setGridVisible(true); |
|||
m_pListView = new QListView(); |
|||
connect(m_pCalendarWidget, &QCalendarWidget::selectionChanged, this, &guiReportsManagerWindow::selectReportDate); |
|||
m_pListView = new QListView( this ); |
|||
m_pListModel = new QStringListModel( m_pListView ); |
|||
m_pListView->setGeometry(200, 20, 300, 400); |
|||
m_pListView->setModel(m_pListModel); |
|||
}; |
|||
|
|||
guiReportsManagerWindow::~guiReportsManagerWindow(){ |
|||
}; |
|||
|
|||
void guiReportsManagerWindow::selectReportDate() { |
|||
QDate sd; |
|||
struct tm STM; |
|||
sd = m_pCalendarWidget->selectedDate(); |
|||
memset(&STM, 0, sizeof(struct tm)); |
|||
STM.tm_year = sd.year() - 1900; |
|||
STM.tm_mon = sd.month() - 1; |
|||
STM.tm_mday = sd.day(); |
|||
if (m_pSystemReport->loadReportList(&STM)) { |
|||
Rere* list; |
|||
list = m_pSystemReport->getLoaddedReports(); |
|||
if (list) { |
|||
QStringList lst; |
|||
m_pListModel->removeRows(0, m_pListModel->rowCount()); |
|||
for (Rere::iterator index = list->begin(); index < list->end(); index++) { |
|||
lst.append(QString(*index)); |
|||
}; |
|||
m_pListModel->setStringList(lst); |
|||
}; |
|||
} else { |
|||
QMessageBox msgBox; |
|||
msgBox.setText("No Data"); |
|||
msgBox.setInformativeText("We do not have reports to selected date."); |
|||
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Discard | QMessageBox::Cancel ); |
|||
msgBox.setDefaultButton(QMessageBox::Ok); |
|||
int ret = msgBox.exec(); |
|||
}; |
|||
}; |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue