Create a modern Car Dashboar using QT framework(QT creator, QT desinger).
- Download QT Framewrk.
- Clone the repository.
- Open QT Design.
- Open project by clicking in project direcotry the "CarDashboard.qml" file.
- C++20 (recommended g++ or clang++)
- CMake 3.21.1
- Qt 6.7.0
- Qt Design Studio 4.4
- Qt Creator 13.0
- clang-format
- clang-tidy
- cppcheck
- ninja
- valgrind
- clone repository:
https://github.com/coders-school/car-dashboard
You can open project with:
- Qt Design Studio
- Run Qt Design Studio and open CarDashboard.qmlproject file.
- User settings are saved in CarDashboard.qmlproject.qtds.
- Qt Creator
- Run Qt Creator and open CMakeLists.txt file.
- User settings are saved in CMakeLists.txt.user.
If you added files in Qt Design Studio (.qml, .png, .svg, ...), you must generete CMake by run executable file.
Open Qt Design. Then File > Export > Generate CMake. In details select CMakes which you want generate and click ok.
Warning: Please commit before generate
- For Unix
cmake -S <PROJECT DIR> -B <BUILD DIR> -DCMAKE_PREFIX_PATH=[QT DIR]/[QT VERSION]/gcc_64 ...
- For Windows
cmake -S <PROJECT DIR> -B <BUILD DIR> -DCMAKE_PREFIX_PATH=[QT DIR]/[QT VERSION]/mingw ...
Example:
cmake -S . -B build -DCMAKE_PREFIX_PATH=/home/user/Qt/6.7.0/gcc_64 -G Ninja
Or
mkdir build
cd build
cmake .. -DCMAKE_PREFIX_PATH=/home/user/Qt/6.7.0/gcc_64
cmake --build <PROJECT DIR>
For ninja:
ninja -C <BUILD DIR>
Examples:
cmake --build build
ninja -C build
./<BUILD DIR>/CarDashboardApp
ctest --test-dir <BUILD DIR>
For ninja:
ninja -C <BUILD DIR> test
Or run executable file directly:
./build/utest/CarDashboardApp_UnitTest
./build/utestQml/CarDashboardApp_UnitTestQml
CMake provided following targets for code analysis:
clang-format
- formating codeclang-format-check
- check formating without chagned codecppcheck-check
- run cppcheckclang-tidy-check
- run clang-tidy without chagned codeclang-tidy-fix
- run clang-tidy and fix code
Run cmake target:
cmake --build <BUILD DIR> --target <TARGET NAME>
For ninja
ninja -C build <TARGET NAME>
CMake targets:
- clang-format
- clang-format-check
CMake targets:
- cppcheck-check
CMake targets:
- clang-tidy-check
- clang-tidy-fix
In the project is added pre-commit
, which is run before commit.
If an error occurred, try: pip install --force-reinstall -U pre-commit
pre-commit install
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
./<BUILD DIR>/CarDashboardApp
- Speed Gauge
- RPM Gauge
- Additional: timer, thermometer etc.
- 3D car model that can be moved by mouse
- Open doors and trunk by using buttons on screen
- Change the temperature by using A/C button
- Change the postion of sit by using sit control button
- Choose number to call
- Adding new phone numbers to phone book
- Change music
- Change beetwen radio and songs
- Mute, volume etc.
- Navigation map
- Search tool bar
- Switching menu beetwen classes (apart from Gauges)
- Seperate Right from the Left side of the screen