Back to index

fet  5.18.0
Public Member Functions
TeachersStatisticsForm Class Reference

#include <teachersstatisticsform.h>

List of all members.

Public Member Functions

 TeachersStatisticsForm (QWidget *parent)
 ~TeachersStatisticsForm ()

Detailed Description

Definition at line 25 of file teachersstatisticsform.h.


Constructor & Destructor Documentation

Definition at line 31 of file teachersstatisticsform.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.teachersList.size());
       
       QStringList columns;
       columns<<tr("Teacher");
       columns<<tr("No. of activities");
       columns<<tr("Duration");
       
       tableWidget->setHorizontalHeaderLabels(columns);
       
       for(int i=0; i<gt.rules.teachersList.size(); i++){
              Teacher* t=gt.rules.teachersList[i];
              
              QTableWidgetItem* newItem=new QTableWidgetItem(t->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->teachersNames.contains(t->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 teachersstatisticsform.cpp.

Here is the call graph for this function:


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