Shopping List

QT application by Toni Suominen

Download .zip file here.
Link to the course home page.

Program description

Name: Shopping List

Short description: The application adds information given by the user to a list.

Long description: The user inputs the name of the item, the price for one piece of the item, and the quantity of items to be bought.
The application concatenates this information and adds as an entry to a listbox. As more item are added, the application also calculates
the total price of all the items and displays it in a label.

Localization: Program was implemented in English, but a Finnish translation is also included.

Status: ALPHA. Many features still need to be added to make the application useful. At this point the program, for example, does not save
the information, so a database might be needed to implement this feature.

Shopping List

Hacking

  1. When the Add to List -button is pushed, the program reads the information the user has inputted,
    and converts the price and quantity from strings to numeric values. (quantity to integer and price to double)
  2. Also the total price of the items is read from the label and converted in to a double.
  3. The price of the item is multiplied by the quantity of items and the result is converted in to a string.
  4. The price of the inputted item is added to the price of all the items and displayed in the label.
  5. A new shopping list entry is concatenated and added to the list as a QListWidgetItem.
  6. Finally the input fields are emptied and the focus is set back to the item field.