void EntityManager::update(float time_s) { mTimeSinceStart_s += time_s; for (int i = 0; i < mEntityToDelete.size(); i++) { if (mTimeSinceStart_s > mEntityToDelete[i].timeOfDeath) { suppr(mEntityToDelete[i].id); mEntityToDelete.erase(mEntityToDelete.begin() + i); } } for (int i = 0; i < mEntity.size(); i++) { Entity *entity = mEntity[i]; if (entity != nullptr && entity->getType() == Entity::MESH) { ((Mesh*)entity)->getPhysicComponent()->getStateComponent()->update(time_s); entity->setModel(((Mesh*)entity)->getPhysicComponent()->getStateComponent()->getModel()); } } }
Favoris::Favoris(QWidget *parent=0) : QTabWidget(parent), pr(parent){ if(!QFile::exists("settingFavoris.ini")){ setting=new QSettings("settingFavoris.ini", QSettings::IniFormat, parent); initialisation();} else setting=new QSettings("settingFavoris.ini", QSettings::IniFormat, parent); QStringList favorisAdresse=setting->value("favorisAdresse").toStringList(); QStringList favorisName=setting->value("favorisName").toStringList(); QFile file("listIcon.ico", pr); QDataStream in(&file); file.open(QIODevice::ReadOnly); QScrollArea *area=new QScrollArea; addTab(area, "Favoris"); favoris=new QWidget; layoutFavoris=new QVBoxLayout; layoutFavoris->setSpacing(0); favoris->setLayout(layoutFavoris); area->setWidget(favoris); area->setBackgroundRole(QPalette::Light); favoris->setFixedWidth(225); for(int i=0; i<favorisName.count(); i++){ QIcon icon; in>>icon; addFavoris(QUrl(favorisAdresse[i]), favorisName[i], icon); connect(listLien[i], SIGNAL(suppr()), this, SLOT(supprFavoris())); connect(listLien[i], SIGNAL(openPage(QUrl)), this, SLOT(openPageS(QUrl))); connect(listLien[i], SIGNAL(openNewPage(QUrl)), this, SLOT(openNewPageS(QUrl))); } setVisible(false); }
void MainWindow::on_pushButtonSupprVisiteur_clicked() { //on suppr QSqlQuery suppr("delete from visiteur WHERE nom='"+this->vis_nom+"' AND prenom='"+this->vis_prenom+"';"); suppr.exec(); //on rafraichit chargerVis(); viderChampVis(); }
void MainWindow::on_pushButtonSupprMedicament_clicked() { //on suppr QSqlQuery suppr("delete from medicament WHERE id='"+this->med_depLeg+"';"); suppr.exec(); //on rafraichit chargerMed(); viderChampMed(); }
void MainWindow::on_pushButtonSupprLabo_clicked() { //on suppr QSqlQuery suppr("delete from labo where nom='"+this->lab_nom+"';"); suppr.exec(); //on rafraichit chargerLabo(); viderChampLabo(); //on met aussi a jour la combo de l'onglet visiteur chargerVis(); }
void MainWindow::on_pushButtonSupprCabinet_clicked() { //on suppr QSqlQuery suppr("delete from cabinet WHERE local='"+this->cab_nom+"';"); suppr.exec(); //on actualise chargerCab(); viderChampsCab(); //on met aussi a jour la combo de l'onglet praticien chargerPrat(); }
void MainWindow::on_pushButtonSupprDepartement_clicked() { //on suppr QString chaineSuppr="delete from departement WHERE nom='"+this->dep_nom+"';"; QSqlQuery suppr(chaineSuppr); suppr.exec(); //on rafraichit chargerDep(); viderChampDep(); //on met aussi a jour la combo de l'onglet visiteur chargerVis(); }
void EntityManager::suppr(unsigned int id) { if (mEntity[id] != nullptr) { for (int i = 0; i < mEntity[id]->getChildren().size(); i++) suppr(mEntity[id]->getChildren()[i]->getId()); delete mEntity[id]; mEntity[id] = nullptr; mFreeIds.insert(id); } }
int main(int argc, char **argv) { int ret; signal(SIGINT, suppr); ordo = read_pid("ordo.dat"); printf("pid ordo = %d\n", ordo); if(argc == 1) { fprintf(stderr, "pas de programme specifié\n" "usage: ./lanceur prog [prog args]\n"); exit(0); } if((pid = fork()) == -1) { perror("erreur fork"); exit(1); } if(pid == 0) { ret = execvp(argv[1], argv+1); if(ret == -1) exit(2); } else { write_pid("pid.dat", pid); printf("Envoi à l'ordo de %d\n", pid); kill(ordo, SIGUSR1); wait(NULL); suppr(0); } return 0; }
menuFormation::menuFormation(cursusManager *man, UVManager* u) { m=man; uvman=u; mainbox=new QVBoxLayout(this); hbox1=new QHBoxLayout(this); hbox2=new QHBoxLayout(this); titre=new QLabel("Choisissez une formation et sélectionnez l'opération:",this); select=new QComboBox(this); visualiser=new QPushButton("Voir les détails",this); ajouter=new QPushButton("Ajouter une formation",this); modifier=new QPushButton("Modifier",this); supprimer=new QPushButton("Supprimer",this); quit=new QPushButton("Quitter",this); sauver=new QPushButton("Sauver",this); select->setFixedWidth(300); mainbox->addLayout(hbox1); mainbox->addLayout(hbox2); hbox1->addWidget(titre); hbox1->addWidget(select); hbox2->addWidget(visualiser); hbox2->addWidget(ajouter); hbox2->addWidget(modifier); hbox2->addWidget(supprimer); hbox2->addWidget(sauver); hbox2->addWidget(quit); QObject::connect(visualiser,SIGNAL(clicked()),this,SLOT(voir())); QObject::connect(ajouter,SIGNAL(clicked()),this, SLOT(ajout())); QObject::connect(modifier,SIGNAL(clicked()),this, SLOT(modif())); QObject::connect(supprimer,SIGNAL(clicked()),this, SLOT(suppr())); QObject::connect(quit,SIGNAL(clicked()),this,SLOT(close())); QObject::connect(sauver, SIGNAL(clicked()),this,SLOT(save())); update(); }
int my_unsetenv(t_mysh *ptr) { int index; index = 0; if (ptr->param[1] == 0) { my_putstr("unsetenv : Too few arguments\n"); return (0); } if (my_strncmp(ptr->param[1], "*", 1) == 0) { free_tab(&ptr->env); return (1); } if (ptr->env != NULL) while (ptr->env[index] != '\0') { if (suppr(ptr, &index) == 1) return (1); index++; } return (1); }
void test(char* t) { suppr('[',t); printf("apres : %s\n",t); }