Use shared pointer to construct qmodel.