A desktop application built with Qt 6.5 / QML that simulates an interactive product menu with a shopping cart.
All business logic is implemented in C++; the UI layer is built entirely in QML.
- 10 real cosmetic products with images, names, prices, and descriptions
- Discounted items are visually highlighted with a distinct background color and a discount badge (e.g.
-25%) - Star rating and review count for each product
- Promotion badges: Bestseller, Gift, Free Shipping
- Clicking a product card opens a modal detail view
- Full product description
- Product image
- Original / sale price with discount percentage and savings amount
- Add to Cart button
- List of selected items with thumbnails, names, and prices
- Quantity per item
- Subtotal per item
- Increase / decrease quantity (
+/−buttons) - Remove individual item
- Clear Cart button
- Total item count and order total
- Savings from item-level discounts
- Automatic volume discount:
- 5% off orders over ₴5,000
- 10% off orders over ₴10,000
| Layer | Technology |
|---|---|
| Language | C++ 17 |
| Framework | Qt 6.5 |
| UI | QML + QtQuick Controls 2 |
| Build system | CMake 3.16+ |
| Data | JSON (Qt Resource System) |
| Images | PNG (Qt Resource System) |
cpp/
├── product.h — Product struct with business methods: hasDiscount, discountPercent, savings
├── cartitem.h — CartItem struct: Product + quantity, totalPrice, totalSavings
├── productmodel.h/cpp — QAbstractListModel: loads products from products.json
└── cartmodel.h/cpp — QAbstractListModel: cart logic, Q_INVOKABLE methods, discount calculation
qml/
├── Main.qml — main window (header + product grid + cart panel)
├── Theme.qml — singleton: colors, icons, helper functions
├── components/
│ ├── ProductCard.qml — product card in the grid
│ ├── BadgeFlow.qml — row of promotion badges
│ └── StarRating.qml — star rating with review count
└── views/
├── CartView.qml — cart side panel
└── ProductDetail.qml — product detail modal
- Qt 6.5.2 or later
- CMake 3.16+
- C++ 17 compatible compiler (GCC 9+, Clang 10+, MSVC 2019+)
- Open
CMakeLists.txtin Qt Creator - Select a Qt 6.5 kit
- Click Build → Run
# Clone the repository
git clone https://github.com/<YOUR_USERNAME>/QtShopMenu.git
cd QtShopMenu
# Configure and build
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
# Run (Windows)
.\build\Release\appQtShopMenu.exeNote: make sure Qt 6.5 libraries are available in
PATH, or specify the path via-DCMAKE_PREFIX_PATH=/path/to/Qt/6.5.x/<kit>.
QtShopMenu/
├── CMakeLists.txt
├── main.cpp
├── cpp/
│ ├── product.h
│ ├── cartitem.h
│ ├── productmodel.h
│ ├── productmodel.cpp
│ ├── cartmodel.h
│ └── cartmodel.cpp
├── qml/
│ ├── Main.qml
│ ├── Theme.qml
│ ├── components/
│ │ ├── ProductCard.qml
│ │ ├── BadgeFlow.qml
│ │ └── StarRating.qml
│ └── views/
│ ├── CartView.qml
│ └── ProductDetail.qml
├── data/
│ └── products.json
└── images/
├── amouage.png
├── biorepair.png
├── charlotte_highlighter.png
├── christina_cream.png
├── dove_shower.png
├── elseve_serum.png
├── laroche_serum.png
├── loreal_mascara.png
├── pantene.png
└── whocares_sun.png