Set up QFunction