WARNING: This is an educational project only.
Go to file
2025-07-21 00:20:08 -05:00
.github/workflows Small fixes 2025-07-21 00:20:08 -05:00
.gitattributes Small fixes 2025-07-21 00:20:08 -05:00
.gitignore Initial commit: Qt Colculator with C++20 2025-07-12 19:11:31 -05:00
build.sh Small fixes 2025-07-21 00:20:08 -05:00
Calculator.cpp Small fixes 2025-07-21 00:20:08 -05:00
Calculator.h Initial commit: Qt Colculator with C++20 2025-07-12 19:11:31 -05:00
CMakeLists.txt Small fixes 2025-07-21 00:20:08 -05:00
main.cpp Initial commit: Qt Colculator with C++20 2025-07-12 19:11:31 -05:00
qt-project.pro Small fixes 2025-07-21 00:20:08 -05:00
README.md Small fixes 2025-07-21 00:20:08 -05:00

Qt Calculator

A simple calculator application built with Qt5 and C++20.

Features

  • Basic arithmetic operations (+, -, *, /)
  • Clear functionality
  • Error handling for division by zero
  • Modern C++ practices (Rule of Five implementation)

Requirements

To compile and run this project, you need:

  • CMake 3.16 or higher
  • Qt5 (Core and Widgets)
  • C++20 compatible compiler

Installing Dependencies

Ubuntu/Debian:

# Full development environment
sudo apt install qtcreator qtbase5-dev qt5-qmake qtbase5-dev-tools cmake

# Minimal required packages
sudo apt install qtbase5-dev qt5-qmake cmake

Verifying Qt5 Installation

Check if Qt5 packages are installed and locate them:

dpkg -l | grep qt5
find /usr -name "Qt5Config.cmake"

If Qt5Config.cmake is not found, install the necessary packages:

sudo apt install qtbase5-dev

Fedora:

sudo dnf install qt5-qtbase-devel qt5-qttools-devel qt-creator cmake

Arch Linux:

sudo pacman -S qt5-base qt5-tools qtcreator cmake

Building the Project

mkdir build && cd build
cmake ..
make

Using QMake (alternative)

qmake qt-project.pro
make

Running the Application

./Calculator

Troubleshooting Qt5 Find Issues

If CMake cannot find Qt5, you can specify the Qt5 path manually:

cmake -DQt5_DIR=/path/to/qt5/lib/cmake/Qt5 ..