Beispiel #1
0
///////////////////////////////////////////////////////////////////////////////
/// @fn get_today( )
/// @brief gets today's date as stored by the validate class on instantiation
/// @return string containing today's date in MM/DD format
///////////////////////////////////////////////////////////////////////////////
string validate::get_today( ) {

  // Make sure today is accurate.
  setToday();
  
  return m_today;

}
Beispiel #2
0
///////////////////////////////////////////////////////////////////////////////
/// @fn validate( void )
/// @brief the default constructor for the validate class
///////////////////////////////////////////////////////////////////////////////
validate::validate() {
  
  //Sets today's date
  setToday();

  //Creates us a new rules system
  m_rules = new rulesSystem( RULESET_PATH );

  // Ensure the global database is open.
  DATABASE.open(DATABASE_PATH);

}
Beispiel #3
0
// --------------------------------------------------------------------------
ctkDateRangeWidget::ctkDateRangeWidget(QWidget* _parent) : Superclass(_parent)
  , d_ptr(new ctkDateRangeWidgetPrivate(*this))
{
  Q_D(ctkDateRangeWidget);
  
  d->setupUi(this);

  d->DateRangeWidget->setVisible(d->SelectRangeRadioButton->isChecked());

  this->setDisplayTime(false);
  this->setDateTimeRange(QDateTime(), QDateTime());
  
  // Note that we connect on the clicked() signal and not the toggled.
  // The clicked() signal is fired only when the USER clicks the radio button
  // and not when the button is checked programatically (except using click()).
  QObject::connect(d->AnyDateRadioButton, SIGNAL(clicked()),
                   this, SLOT(setAnyDate()));
  QObject::connect(d->TodayRadioButton, SIGNAL(clicked()),
                   this, SLOT(setToday()));
  QObject::connect(d->YesterdayRadioButton, SIGNAL(clicked()),
                   this, SLOT(setYesterday()));
  QObject::connect(d->LastWeekRadioButton, SIGNAL(clicked()),
                   this, SLOT(setLastWeek()));
  QObject::connect(d->LastMonthRadioButton, SIGNAL(clicked()),
                   this, SLOT(setLastMonth()));
  QObject::connect(d->SelectRangeRadioButton, SIGNAL(clicked()),
                   this, SLOT(setSelectRange()));

  QObject::connect(d->StartDate, SIGNAL(dateTimeChanged(const QDateTime&)),
                   this, SIGNAL(startDateTimeChanged(const QDateTime&)));
  QObject::connect(d->EndDate, SIGNAL(dateTimeChanged(const QDateTime&)),
                   this, SIGNAL(endDateTimeChanged(const QDateTime&)));
  QObject::connect(d->StartDate, SIGNAL(dateTimeChanged(const QDateTime&)),
                   this, SLOT(onDateTimeChanged()));
  QObject::connect(d->EndDate, SIGNAL(dateTimeChanged(const QDateTime&)),
                   this, SLOT(onDateTimeChanged()));
}
Beispiel #4
0
//! Construtor
FilterDialog::FilterDialog(FilterDialogType fType, QWidget* parent, Qt::WFlags f)
: QDialog(parent, f)
{
  setupUi(this);

  _filterChanged = false;
  _ignoreChangeEvents = false;

  connect(areaRdb, SIGNAL(clicked()), SLOT(filterTypeToggled()));
  connect(planeRdb, SIGNAL(clicked()), SLOT(filterTypeToggled()));
  connect(noAreaFilterRdb, SIGNAL(clicked()), SLOT(filterTypeToggled()));
  connect(tabWidget, SIGNAL(currentChanged(int)), SLOT(filterTypeToggled()));

  connect(okBtn,     SIGNAL(clicked()), SLOT(accept()));
  connect(cancelBtn, SIGNAL(clicked()), SLOT(reject()));

  connect(dateBeforeFilterCbx, SIGNAL(stateChanged(int)), SLOT(setFilterChanged()));
  connect(dateAfterFilterCbx, SIGNAL(stateChanged(int)), SLOT(setFilterChanged()));
  connect(dateBeforeFilterDed, SIGNAL(dateChanged(const QDate&)), SLOT(setFilterChanged()));
  connect(dateAfterFilterDed, SIGNAL(dateChanged(const QDate&)), SLOT(setFilterChanged()));
  
  connect(noAreaFilterRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(areaRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(planeRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(xMinLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(xMaxLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(yMinLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(yMaxLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(themeListWidget, SIGNAL(currentRowChanged(int)), SLOT(setFilterChanged()));

  connect(noPreAnalysisRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(allSmallerThanRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(allLargerThanRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(belowAverageRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(aboveAverageRdb, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  
  connect(allSmallerThanLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(allLargerThanLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(belowAverageLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));
  connect(aboveAverageLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));

  connect(noPreAnalysisRdb, SIGNAL(clicked(bool)), SLOT(disablePAThemeBox()));
  connect(allSmallerThanRdb, SIGNAL(clicked(bool)), SLOT(enablePAThemeBox()));
  connect(allLargerThanRdb, SIGNAL(clicked(bool)), SLOT(enablePAThemeBox()));
  connect(belowAverageRdb, SIGNAL(clicked(bool)), SLOT(enablePAThemeBox()));
  connect(aboveAverageRdb, SIGNAL(clicked(bool)), SLOT(enablePAThemeBox()));

  connect(preAnalysisThemeBox, SIGNAL(clicked(bool)), SLOT(setFilterChanged()));
  connect(preAnalysisThemeList, SIGNAL(currentRowChanged(int)), SLOT(setFilterChanged()));

  connect(bandFilterLed, SIGNAL(textChanged(const QString&)), SLOT(setFilterChanged()));

  connect(newDummyChk, SIGNAL(stateChanged(int)), SLOT(setFilterChanged()));
  connect(dummyValueSpb, SIGNAL(valueChanged(double)), SLOT(setFilterChanged()));

  connect(beforeTodayBtn, SIGNAL(clicked()), SLOT(setToday()));
  connect(afterTodayBtn, SIGNAL(clicked()), SLOT(setToday()));

  // Define os tipos para validação (filtro)
  xMinLed->setValidator(new QDoubleValidator(xMinLed));
  xMaxLed->setValidator(new QDoubleValidator(xMaxLed));
  yMinLed->setValidator(new QDoubleValidator(yMinLed));
  yMaxLed->setValidator(new QDoubleValidator(yMaxLed));

  allSmallerThanLed->setValidator(new QDoubleValidator(allSmallerThanLed));
  allLargerThanLed->setValidator(new QDoubleValidator(allLargerThanLed));
  belowAverageLed->setValidator(new QDoubleValidator(belowAverageLed));
  aboveAverageLed->setValidator(new QDoubleValidator(aboveAverageLed));

  QRegExp regExp("^[0-9]+(-[0-9]+)?(,[0-9]+(-[0-9]+)?)*$");
  bandFilterLed->setValidator(new QRegExpValidator(regExp, bandFilterLed));

  if (fType == DATEFILTER)
  {
	  tabWidget->setTabEnabled(1,false); // area
	  tabWidget->setTabEnabled(2,false); // pre
	  tabWidget->setTabEnabled(3,false); // band
	  tabWidget->setTabEnabled(4,false); // dummy
  }
  else if (fType == AREAFILTER)
  {
	  tabWidget->setTabEnabled(0,false); // date
	  tabWidget->setTabEnabled(2,false); // pre
	  tabWidget->setTabEnabled(3,false); // band
	  tabWidget->setTabEnabled(4,false); // dummy
  }
  else if (fType == NO_BANDFILTER)
  {
	  tabWidget->setTabEnabled(3,false); // band
  }

  preAnalysisThemeBox->setDisabled(true);
  okBtn->setEnabled(false);
}
Beispiel #5
0
	CalendarModel::CalendarModel(QObject *parent):
		QAbstractTableModel(parent),
		m_first_day_of_week(Qt::Sunday) {
		setToday();
	}