Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class test : public QObject{
- Q_OBJECT
- private:
- ...............................................
- public:
- test();
- public slots:
- void txt();
- signals:
- void ok();
- };
- test::test(){
- ................................................
- connect(p, SIGNAL(clicked()), SIGNAL(ok()));
- }
- void test::txt(){
- l->setText("ok");
- }
- ....................................................
- test a, b;
- QObject::connect(&a, SIGNAL(ok()), &b, SLOT(txt()));
- QObject::connect(&b, SIGNAL(ok()), &a, SLOT(txt()));
- ....................................................
- class test : public QObject{
- Q_OBJECT
- private:
- ................................................
- public:
- test();
- public slots:
- void txt(QString);
- signals:
- void ok(QString);
- };
- test::test(){
- ......................................................
- connect(p, SIGNAL(clicked()), SIGNAL(ok("word")));
- }
- void test::txt(QString s){
- l->setText("ok");
- }
- ....................................................
- test a, b;
- QObject::connect(&a, SIGNAL(ok()), &b, SLOT(txt()));
- QObject::connect(&b, SIGNAL(ok()), &a, SLOT(txt()));
- ....................................................
- connect(p, SIGNAL(clicked()), SIGNAL(ok("word")));
Add Comment
Please, Sign In to add comment