t1->setSingleShot(true);
t2->setSingleShot(true);
t3->setSingleShot(true);
connect(t1, SIGNAL(timeout()), mapper, SLOT(map()));
connect(t2, SIGNAL(timeout()), mapper, SLOT(map()));
connect(t3, SIGNAL(timeout()), mapper, SLOT(map()));
mapper->setMapping(t1, "abc");
mapper->setMapping(t2, "def");
mapper->setMapping(t3, "ghi");
t1->start(1000);
t2->start(2000);
t3->start(3000);
QSignalMapper *mapper = new QSignalMapper(this);
QTimer *t1 = new QTimer(this);
QTimer *t2 = new QTimer(this);
QTimer *t3 = new QTimer(this);
t1->setSingleShot(true);
t2->setSingleShot(true);
t3->setSingleShot(true);
connect(t1, SIGNAL(timeout()), mapper, SLOT(map()));
connect(t2, SIGNAL(timeout()), mapper, SLOT(map()));
connect(t3, SIGNAL(timeout()), mapper, SLOT(map()));
connect(mapper, SIGNAL(mapped(QString)), this, SLOT(dati(QString)));
mapper->setMapping(t1, "abc");
mapper->setMapping(t2, "def");
mapper->setMapping(t3, "ghi");
t1->start(1000);
t2->start(2000);
t3->start(3000);
To copy to clipboard, switch view to plain text mode
Bookmarks