C++ (Qt)connect(send, SIGNAL(clicked()), SLOT(sendMessage()));
QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(update())); timer->start(1000);
C++ (Qt)QTimer *timer = new QTimer(this);connect(timer, SIGNAL(timeout()), this, SLOT(sendMessage()));timer->setInterval(40); QPushButton *btn = new QPushButton(tr("Send"), this);connect(btn , SIGNAL(clicked()), timer, SLOT(start()));
C++ (Qt)connect(send, SIGNAL(clicked()), SLOT(sendMessage())); void sendMessage(){ send message ... QEventLoop loop; QTimer::singleShot(40, &loop, SLOT(quit())); loop.exec(); sendMessage();}