CambioAccUt::CambioAccUt(LinQedInAdmin* ut, mainAdmin* from, QScrollArea* cornice):
    admin(ut), pagPadre(from), areaRisultato(cornice) {

    this->setStyleSheet("background-color:lightblue;");
    this->setFixedSize(450, 330);
    QRect screenGeometry=QApplication::desktop()->screenGeometry();
    int x=(screenGeometry.width()-width())/2;
    int y=(screenGeometry.height()-height())/2;
    move(x,y);

    QLabel* intestazione= new QLabel(this);
    intestazione->setText("Selezionare l'utente nell'elenco \ne la nuova tipologia di account che si desidera assegnare:");
    intestazione->setGeometry(20,15,450,40);
    intestazione->setWordWrap(true);

    elenco=new QListWidget(this);
    elenco->setGeometry(20,60,150,250);
    elenco->setStyleSheet("background-color:white;");
    elenco->setFrameShadow(QFrame::Raised);
    elenco->setFrameShape(QFrame::WinPanel);
    elenco->setLineWidth(1);


    vector<Utente*> utentiPresenti=admin->getDB()->getDatabase();
    vector<Utente*>::const_iterator iter=utentiPresenti.begin();
    while(iter!=utentiPresenti.end()){
        elenco->addItem((*iter)->getUsername().getLogin().data());
        ++iter;
    }
    connect(elenco,SIGNAL(clicked(QModelIndex)),this,SLOT(mostraTipologia()));

    QLabel* tipoAcc= new QLabel(this);
    tipoAcc->setText("Tipologie di account:");
    tipoAcc->setGeometry(200,130,150,20);
    basic=new QRadioButton("Basic",this);
    business=new QRadioButton("Business",this);
    executive=new QRadioButton("Executive",this);
    basic->setGeometry(215,160,100,20);
    business->setGeometry(215,190,100,20);
    executive->setGeometry(215,220,100,20);

    tastoCambia=new QPushButton("Cambia tipologia",this);
    tastoCambia->setGeometry(185,265,130,30);
    tastoCambia->setStyleSheet("background-color:white;");
    tastoCambia->setEnabled(false);
    QPushButton* annulla=new QPushButton("Annulla",this);
    annulla->setGeometry(330,265,100,30);
    annulla->setStyleSheet("background-color:white;");

    connect(tastoCambia,SIGNAL(released()),this,SLOT(cambia()));
    connect(annulla,SIGNAL(released()),this,SLOT(annulla()));
}
Exemple #2
0
int main(int argc, char *argv[]){

    struct TAlumno al1, al2;

    strcpy(al1.nombre, "Juan");
    al2 = al1;
    strcpy(al2.nombre, "Pepe");
    printf("%s\n", al1.nombre);

    cambia(al1);

    printf("%s\n", al1.nombre);

    return EXIT_SUCCESS;
}
Exemple #3
0
int main(void){
	
	char b,c,s[N];
	int count=0,i;

	b=getchar();
	getchar();

	while((c=getchar())!='.' && count<N){
		s[count]=c;
		count++;
	}

	for(i=0;i<count;i++)
		printf("%c",cambia(b,s[i]));
	
	printf("\n");

	return 0;
}