Informations.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <QWidget>
  2. #include <QFileDialog>
  3. #include <QVBoxLayout>
  4. #include <QHBoxLayout>
  5. #include <QDebug>
  6. #include "Informations.hpp"
  7. Informations::Informations (QString &fts):QMainWindow(),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. fileToSave = "test.txt";
  35. close();
  36. }