コード例 #1
0
EditStudiesInfosWidget::EditStudiesInfosWidget(const LinQedInClient* cl,QWidget* parent):EditInfosWidget(parent,
                                                                                                    tr("Modifica informazioni di studio"),
                                                                                                    cl){
    setAttribute(Qt::WA_DeleteOnClose);
    try{
        infos=dynamic_cast<const Studies*>(&getProfile().getInformationsBySectionName(Studies::getIDString()));
    }catch(const NoInfoException&){infos=0;}
    formWidget=new QFrame;
    form=new QFormLayout;
    highSchool=new QLineEdit; qualification=new QLineEdit;
    connect(highSchool,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(qualification,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    form->addRow(tr("Scuola Superiore: "),highSchool); form->setAlignment(highSchool,Qt::AlignCenter);
    form->addRow(tr("Qualificazione Professionale: "),qualification); form->setAlignment(qualification,Qt::AlignCenter);
    initDegrees();

    noDegree=new QLabel(noDegreeS);
    noDegree->setStyleSheet(GUIStyle::errorLabelStyle());
    form->addWidget(noDegree); form->setAlignment(noDegree,Qt::AlignCenter);

    addDegree=new QPushButton(tr("Aggiungi Laurea"));
    addDegree->setCursor(QCursor(Qt::PointingHandCursor));
    form->addWidget(addDegree); form->setAlignment(addDegree,Qt::AlignCenter);
    connect(addDegree,SIGNAL(clicked()),this,SLOT(addRow()));

    formWidget->setLayout(form);
    addWidgetToMainLayout(formWidget,Qt::AlignCenter);
    initButtons();
    formWidget->setObjectName("form");
    formWidget->setStyleSheet("#form{"+GUIStyle::borderStyle()+"padding-left:10px;padding-top:10px;}");
    writeDefaultValues();
}//EditStudiesInfosWidget
コード例 #2
0
EditPersonalInfosWidget::EditPersonalInfosWidget(QWidget* parent,const LinQedInClient* cl):EditInfosWidget(parent,
                                                                                                    tr("Modifica informazioni personali"),
                                                                                                    cl),
    infos(getProfile().getPersonalInformations()){
    setAttribute(Qt::WA_DeleteOnClose,true);
    formWidget=new QWidget;
    infosLayout=new QFormLayout;
    name=new QLineEdit; surname=new QLineEdit; birthplace=new QLineEdit; birthState=new QLineEdit;
    connect(name,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(surname,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(birthplace,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(birthState,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    infosLayout->addRow(tr("Nome: "),name); infosLayout->setAlignment(name,Qt::AlignCenter);
    infosLayout->addRow(tr("Cognome: "),surname); infosLayout->setAlignment(surname,Qt::AlignCenter);
    infosLayout->addRow(tr("Luogo di Nascita: "),birthplace); infosLayout->setAlignment(birthplace,Qt::AlignCenter);
    infosLayout->addRow(tr("Paese di Nascita: "),birthState); infosLayout->setAlignment(birthState,Qt::AlignCenter);
    initRadioButtons();
    infosLayout->addRow(tr("Sesso: "),genderBox); infosLayout->setAlignment(genderBox,Qt::AlignCenter);
    calendar=new QCalendarWidget;
    calendar->setGridVisible(true);
    calendar->setMinimumDate(QDate(1950,1,1));
    calendar->setMaximumDate(QDate::currentDate().addYears(-16)); //dai 16 anni in su
    calendar->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
    infosLayout->addRow(tr("Data di Nascita"),calendar);
    formWidget->setObjectName("form");
    formWidget->setStyleSheet("#form{"+GUIStyle::borderStyle()+"}");
    formWidget->setContentsMargins(10,10,10,10);
    formWidget->setLayout(infosLayout);
    addWidgetToMainLayout(formWidget,Qt::AlignCenter);
    initButtons();

    writeDefaultValues();
}//EditPersonalInfosWidget
コード例 #3
0
PersistentSettings::PersistentSettings(void):
  // NOTE: AVRs have a bug, that when power is down while writing to EEPROM
  //       contents of the first byte may change. to avoid this, it must no
  //       be used inside the program
  posMin_(1+0*SERVO_COUNT),
  posDef_(1+1*SERVO_COUNT),
  posMax_(1+2*SERVO_COUNT),
  flags_ (1+3*SERVO_COUNT)
{
  if(flags_.read(0)==flags_.read(1))
  {
    writeDefaultValues();
    flags_.write(0, 0x42);      // just mark that something has changed
  }
  uassert(flags_.read(0)!=flags_.read(1));
}
コード例 #4
0
EditOccupationsInfosWidget::EditOccupationsInfosWidget(const LinQedInClient* cl,QWidget* parent):EditInfosWidget(parent,
                                                                                                            tr("Modifica esperienze lavorative"),
                                                                                                            cl),
    calendar(0){
    setAttribute(Qt::WA_DeleteOnClose,true);
    try{
        infos=dynamic_cast<const Occupations*>(&getProfile().getInformationsBySectionName(Occupations::getIDString()));
    }catch(const NoInfoException&){infos=0;}
    initJobs();

    noJob=new QLabel(noJobS);
    noJob->setStyleSheet(GUIStyle::errorLabelStyle());
    addWidgetToMainLayout(noJob,Qt::AlignCenter);

    addJob=new QPushButton(tr("Aggiungi Lavoro"));
    addJob->setCursor(QCursor(Qt::PointingHandCursor));
    addWidgetToMainLayout(addJob,Qt::AlignCenter);
    connect(addJob,SIGNAL(clicked()),this,SLOT(addRow()));

    initButtons(true,true,true);
    writeDefaultValues();
}//EditOccupationsInfosWidget