qtdelay provide a single marco function which is able to execute a part of the code after the specified delay.
it won't block the thread beacuase it's based on QTimer.
-
Put
qtdelay.hinto your project, add it into.pro, and enable C++11 by addingQMAKE_CXXFLAGS += -std=c++11. -
Use it like
QtDelay(1000, {qDebug()<<"Hello";});. this code will outputhelloafter 1 second.