|
Lors du clic sur le bouton Ellipse:
|
| Fichier.h |
class myClass : public Qobject {
Q_OBJECT
...
signals:
void event ();
...
public slots:
void action ();
...
};
|
| Fichier.cxx |
...
emit(evenementSurvenu());
...
connect(myClass,SIGNAL(event(),myClass,SLOT(action());
|
|
#include <QApplication> #include <QPushButton> |
Headers de Qt
|
|
int main(int argc, char *argv[]) { |
|
| QApplication app(argc, argv); |
Création de l'application
|
| QPushButton hello("Hello world!"); |
Création d'un bouton
|
| hello.resize(100, 30); |
Redimentionnement
|
| hello.show(); |
Affichage du bouton
|
|
return app.exec(); } |
Lancement de L'application et attende de la fin
|