Bonjour,

Je souhaite créer un fichier txt pour écrire dedans.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
void fen_programmation::ecriture_sequences()
{
    QString nom_fichier;
 
    while((nom_fichier = QInputDialog::getText(NULL,"Fichier","Quel est le nom du fichier ?")).isEmpty())
        QMessageBox::critical(NULL,"Erreur","Aucun nom de fichier n'a été spécifié !");
 
    QFile fichier(nom_fichier);
 
    fichier.setFileName(nom_fichier+".txt");
 
    if (!fichier.open(QIODevice::WriteOnly | QIODevice::Text))
        return;
 
    QTextStream flux(&fichier);
    flux.setCodec("UTF-8");
 
    if(action1GrpBox->isFlat() == 1)  //Si groupe boxe est validé (n'a plus le fond gris)
    {
        flux << choixAction1->currentText() << " " << mouvAction1->text() << " " << vitesseAction1 << endl;
 
        if(action2GrpBox->isFlat() == 1)
        {
            flux << choixAction2->currentText() << " " << mouvAction2->text() << " " << vitesseAction2 << endl;
 
            if(action3GrpBox->isFlat() == 1)
            {
                flux << choixAction3->currentText() << " " << mouvAction3->text() << " " << vitesseAction3 << endl;
 
                if(action4GrpBox->isFlat() == 1)
                {
                    flux << choixAction4->currentText() << " " << mouvAction4->text() << " " << vitesseAction4 << endl;
 
                    if(action5GrpBox->isFlat() == 1)
                    {
                        flux << choixAction5->currentText() << " " << mouvAction5->text() << " " << vitesseAction5 << endl;
                    }
                }
            }
        }
    }
    fichier.close();
    QMessageBox::information(NULL,"Fichier Enregistrer","Fichier Enregistrer");
}
Le code s'exécute parfaitement mais aucun fichier n'est créé. Je ne vois d'où vient le problème, auriez vous une idée ?