You can call sleep() in any function but if it is in the main (GUI) thread your application will freeze and become unresponsive. You could try:
Qt Code:
  1. while(timeIsntUp)
  2. QCoreApplication::processEvents();
To copy to clipboard, switch view to plain text mode 
You will probably have to block the user from repeating the action which lead to the function being called. I.e. graying out a button or something similar.