Alright guys, I'm in quite a situation.
I have a project for school to create an application in C++ that can create and generate shopping dockets/receipts. This includes being able to add the names of the items, the prices, and then finding the total price of the purchase.
We can use a GUI (for extra marks), or stick to a simple CLI program. Being one of the higher achievers in the class, I decided to dive into the deep end, and downloaded and installed Qt.
Now, I've created my GUI, and this is essentially what it looks like so far.


However, nothing at all is functional as of yet (except File > Exit). The receipt preview to the right is simply a label that I've made myself. I have replaced it with a listWidget, as I think a list would be the way to go, but really I have no idea.

What I would like to do is to be able to type the name and price of an item, and then click Add Item to add it to the list. Remove Item would remove the selected item from the list. The prices of the items would be totaled and output at the bottom of the items.
Being able to print the receipt would be a nice final touch, but it isn't necessary and will only gain some bonus marks.

I am basically asking for any help at all, or any pointers (har har) in the right direction.
I have found this tutorial online, which looks immensely helpful but unfortunately is for a previous version of Qt and is thus outdated:

Any help at all is really appreciated. At the moment I'm reading through a lot of documentation and beginner guides to try and grasp the concepts of Qt, but I'm really starting to worry due to the fast-approaching due date.

Thanks in advance.

Edited by DLKenji: n/a

7 Years
Discussion Span
Last Post by WolfPack

I have found this tutorial online, which looks immensely helpful but unfortunately is for a previous version of Qt and is thus outdated:

What version of QT is used in the Tutorial? What version are you using?


Sorry I should have mentioned that.
I believe the tutorial is using some 3.x version. I am using the latest, 4.7. The main issue is the removal of custom slots in Qt 4. I think this is still possible through code but I really wouldn't know where to begin with that.


Since the List Box is a fairly basic control, there shouldn't be much difference in functionality between versions. This seems a fairly easy tutorial, and seems to be just what you want out of your application too.
1. Add items from the text box.
2. Remove the selected item.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.