I am aware that to execute something in a separate thread, one can simply extend QThread, implement run(), and write the pertinent code in the run method. But is there a way to execute an arbitrary block of code in a separate thread w/o having to create a whole new class? For example, maybe when I click a button I want a task to be executed in a separate thread, etc. Thanks.