Qt extracts data from the database and assigns values to variables