Back to index

fet  5.18.0
Public Member Functions
SubjectsStatisticsForm Class Reference

#include <subjectsstatisticsform.h>

List of all members.

Public Member Functions

 SubjectsStatisticsForm (QWidget *parent)
 ~SubjectsStatisticsForm ()

Detailed Description

Definition at line 25 of file subjectsstatisticsform.h.


Constructor & Destructor Documentation

Definition at line 31 of file subjectsstatisticsform.cpp.

                                                             : QDialog(parent)
{
       setupUi(this);
       
       closeButton->setDefault(true);
       
       connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));

       tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
       tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
              
       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);
              
       tableWidget->clear();
       tableWidget->setColumnCount(3);
       tableWidget->setRowCount(gt.rules.subjectsList.size());
       
       QStringList columns;
       columns<<tr("Subject");
       columns<<tr("No. of activities");
       columns<<tr("Duration");
       
       tableWidget->setHorizontalHeaderLabels(columns);
       
       for(int i=0; i<gt.rules.subjectsList.size(); i++){
              Subject* s=gt.rules.subjectsList[i];
              
              QTableWidgetItem* newItem=new QTableWidgetItem(s->name);
              newItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
              tableWidget->setItem(i, 0, newItem);

              int    nSubActivities=0;
              int nHours=0;
              
              foreach(Activity* act, gt.rules.activitiesList)
                     if(act->active)
                            if(act->subjectName==s->name){
                                   nSubActivities++;
                                   nHours+=act->duration;
                            }

              newItem=new QTableWidgetItem(CustomFETString::number(nSubActivities));
              newItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
              tableWidget->setItem(i, 1, newItem);

              newItem=new QTableWidgetItem(CustomFETString::number(nHours));
              newItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
              tableWidget->setItem(i, 2, newItem);
       }

       tableWidget->resizeColumnsToContents();
       tableWidget->resizeRowsToContents();
}

Here is the call graph for this function:

Definition at line 86 of file subjectsstatisticsform.cpp.

Here is the call graph for this function:


The documentation for this class was generated from the following files: