How madhawapolkotuwa/drinkbar works
Drink Bar is a Qt Quick drink-machine selection demo. The intended user journey is to choose a drink category and drink, configure size and (for hot drinks) sugar, confirm, wait through preparation, and see the completion screen. The C++ entry point loads three catalog models from JSON and registers a controller that stores selections and emits a preparation-finished signal after a timer. Screen-to-screen wiring is inferred from screen names; those links are dashed because the QML source was not shown.
Main entry points: main.cpp Qt entry point · drinkmodel.cpp Catalog model · hotdrinkmodel.h Hot drinks · cooldrinkmodel.h Cool drinks
Components 18
Application
- Qt entry point
main.cpp - QML root
Main.qml
Drink catalog
- Drink catalog data
Ui/assets/AllDrinks.json - Catalog model
Models/drinkmodel.cpp - Hot drinks
Models/hotdrinkmodel.h - Cool drinks
Models/cooldrinkmodel.h - Fresh juices
Models/freshjuicemodel.h - Drink record
Models/drink.h
Ordering flow
- Temperature choice
Ui/HotCoolSelectScreen.qml - Drink selection
Ui/DrinkSelectScreen.qml - Size selection
Ui/SizeSelectScreen.qml - Sugar selection
Ui/SugarLevelSelectScreen.qml - Order confirmation
Ui/ConfirmationScreen.qml - Preparation screen
Ui/PreparingDrinkScreen.qml - Completion screen
Ui/EnjoyMegScreen.qml - Drink item view
Ui/Items/DrinkCustomItem.qml
Selection and preparation
- System controller
Controllers/systemcontroller.cpp
Other components
- Customer
Connections 23
- Customer → QML root: uses
- Qt entry point → QML root: loads
main.cpp - Qt entry point → Hot drinks: creates and loads
main.cpp - Qt entry point → Cool drinks: creates and loads
main.cpp - Qt entry point → Fresh juices: creates and loads
main.cpp - Qt entry point → System controller: registers
main.cpp - Hot drinks → Drink catalog data: loads
- Cool drinks → Drink catalog data: loads
- Fresh juices → Drink catalog data: loads
- Hot drinks → Catalog model: inherits
- Cool drinks → Catalog model: inherits
- Fresh juices → Catalog model: inherits
Models/freshjuicemodel.h - Catalog model → Drink record: uses records
- System controller → Drink record: creates and stores
Controllers/systemcontroller.cpp - QML root → Temperature choice: shows
- Temperature choice → Drink selection: continues to
- Drink selection → Drink item view: renders
- Drink selection → Size selection: continues to
- Size selection → Sugar selection: continues to
- Sugar selection → Order confirmation: continues to
- Order confirmation → Preparation screen: continues to
- Preparation screen → Completion screen: continues to
- Preparation screen → System controller: starts preparation