Is it ok to do the following?
worker->moveToThread(workerthread);
...
worker->deleteLater();//this is called from main thread.
Will the worker be properly deleted? I cannot find any Qt documentation said anything about this.
If you move a worker object to a thread, and you'll want to use signal/slot connections to communicate with the worker object, Qt will be using an event loop running on another thread to send and receive signals. This is the reasoning behind using QObject::deleteLater(): it allows for a scheduled, safe deletion of an object that is guaranteed not to occur when one of the object's slots is being executed in a thread.
You can find more about deleteLater in the Qt documentation for QObject:
Schedules this object for deletion.
The object will be deleted when control returns to the event loop. If the event loop is not running when this function is called (e.g. deleteLater() is called on an object before QCoreApplication::exec()), the object will be deleted once the event loop is started. If deleteLater() is called after the main event loop has stopped, the object will not be deleted. Since Qt 4.8, if deleteLater() is called on an object that lives in a thread with no running event loop, the object will be destroyed when the thread finishes.
Also, in the Qt documentation for QThread you can find a common use-case for deleteLater():
From Qt 4.8 onwards, it is possible to deallocate objects that live in a thread that has just ended, by connecting the finished() signal to QObject::deleteLater().
This question provides more detail on different circumstances that deleteLater() is appropriately used in: When to use deleteLater. Particularly, see Kuba Ober's answer.