Informations.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include <QWidget>
  2. #include <QFileDialog>
  3. #include <QVBoxLayout>
  4. #include <QHBoxLayout>
  5. #include <QDebug>
  6. #include "Informations.hpp"
  7. Informations::Informations (QString &ftl, QString &fts):QMainWindow(),fileToLoad(ftl), fileToSave(fts)
  8. {
  9. setWindowTitle (tr ("DSL - Draw Strength Line"));
  10. QWidget *central= new QWidget(this);
  11. setCentralWidget (central);
  12. QVBoxLayout *layoutV = new QVBoxLayout(central);
  13. central->setLayout(layoutV);
  14. // First line of the interface
  15. QHBoxLayout *layoutH1 = new QHBoxLayout(central);
  16. layoutV->addLayout(layoutH1);
  17. nameL = new QLabel("Nom : ", central);
  18. layoutH1->addWidget(nameL);
  19. nameT = new QTextEdit(central);
  20. layoutH1->addWidget(nameT);
  21. // Second line of the interface
  22. QHBoxLayout *layoutH2 = new QHBoxLayout(central);
  23. layoutV->addLayout(layoutH2);
  24. surnameL = new QLabel("Prénom : ", central);
  25. layoutH2->addWidget(surnameL);
  26. surnameT = new QTextEdit(central);
  27. layoutH2->addWidget(surnameT);
  28. readyB = new QPushButton("Prêt !");
  29. connect(readyB, SIGNAL(clicked(bool)), this, SLOT(ready()));
  30. layoutV->addWidget(readyB);
  31. }
  32. void Informations::ready(){
  33. qDebug() << "Je suis prêt" << Qt::endl;
  34. fileToLoad = "filetoLoad.json";
  35. fileToSave = "fileToSave.json";
  36. close();
  37. }