
#include "exemple.h"
#include <QApplication>
#include <QPushButton>
#include <QInputDialog>
#include <QMessageBox>

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  Exemple exemple;

  exemple.show();
  return app.exec();
}

Exemple::Exemple()
  :QMainWindow()
{
  button = new QPushButton("Hello!", this);
  
  connect(button, SIGNAL(clicked()), this, SLOT(s_clicked()));
  connect(this, SIGNAL(pseudoclick(QString&)), this, SLOT(s_clicked_texte(QString&)));
}

void Exemple::s_clicked()
{
  QString texte = QInputDialog::getText(this, "Demande", "Entrez du texte");
  emit s_clicked_texte(texte);
}

void Exemple::s_clicked_texte(QString& texte)
{
  QMessageBox message(QMessageBox::Information, "Ceci est un test d'information", "Le tesxte\n" + texte + "\na été entréé");
  message.exec();
}
