probleme boutons inopérant
Bonsoir,
J'ai encore un probleme: lorsque j'apuis sur le bouton "afficher second bouton", il devrai m'afficher le bouton "second bouton" mais rien ne se passe.
Voici le code :
fonctiono.h
Code:
1 2 3 4 5 6 7 8
| #ifndef P
#include <QPushButton>
#endif
class bdd : public QPushButton
{
public slots:
void pish(QPushButton &ref);
}; |
fonctiono.cpp
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| #ifndef P
#include <iostream>
#include <QApplication>
#include <QPushButton>
#include "fonctiono.h"
using namespace std;
#endif
void bdd::pish(QPushButton &ref)
{
ref.show();
} |
main.cpp
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #define P
#include <iostream>
#include <QApplication>
#include <QPushButton>
#include "fonctiono.h"
using namespace std;
int main(int argc, char *argv[])
{
QApplication app(argc,argv);
QPushButton bouton("afficher second bouton");
QPushButton b2("second bouton");
bdd objet;
bouton.show();
QPushButton::connect(&bouton, SIGNAL(clicked()),&objet, SLOT(pish(b2)));
return app.exec();
} |
Pouvez vous m'aider à résoudre ce probleme?
merci d'avance