The aim in this week is to start working in a new Qt project.
.. In addition we practice design-by-contract (pre- and postconditions and
.. class invariants) and get familiar with Doxygen, which enables
.. embedding documentation into the comments in source code.
The exercise is compulsory so you must complete parts: Qt project and Tags. The submission is done with the help of version control. Remember to commit your work frequently.
The files needed in this task can be pulled from version control. They are in repository student_template_project You must set it as a remote to your local repository. The codes needed in this exercise are in the directory EX1. Note that you do not have rights to update the repository.
On this course, you need to use other remote reposiories in addition to your own to fecth material for course work. Hence, you need to add another remote into your working directory in addition to origin. This is done with: git remote.
git remote add upstream student_template_project.git-URL
git pull upstream HEAD
NOTE! The URL of the remote is decided based on whether you have set the SSH key to GitLab or not.
Start the exercise by creating a Qt-project for it: New Project-> Non-Qt Project->Plain C++ Application. The project must be named DesignByContract. Create it into the same directory ar the codes pulled from version control EX1.
New Project-> Non-Qt Project->Plain C++ Application
Qt will create a new subdirectory into you directory. Move the codes needed in the excercise there git mv, e.g. git mv file.txt Dir/
git mv file.txt Dir/
Open DesignByContract.pro and fix a couple of important things in it: the compiler should use C++ version C++17and Qt’s libraries.
CONFIG += console c++17
CONFIG += qt
After this add the files for the exericse in to the .pro-file. This can be done from Qt’s user interface from right-click DesignByContract->add existing files...
DesignByContract->add existing files...
SOURCES += \
DISTFILES += \
HEADERS += \
On the course, all code submissions are done through version control. Before you can go into submitting this week’s work, you need to check it is in a correct state. You can see this from GitLab:
Submit your work with a tag starting with EX1_submission. A tag is created:
git tag -a "EX1_submission" --message "Message for tag here"
git push origin HEAD
git push origin --tags
It is important to remember to push both the changes and the tags.
A+ presents the exercise submission form here.