Use QThread for main application