sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
Before we even start any coding, for any large scale project, it is best to first write a "to do list". There is probably a professional name for this, but I will just call it a feature list.
The feature list should contain a very rough outline of what you want to have in your final product. Almost certainly, this will change, but the feature list gives us somewhat of a project overview.
The app that we are trying to build in this tutorial is essentially a rebuild of Colours++ from my Science project, so the features list is quite simple.
- explanation (to show scrollable GUI in SGWidget ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾)
- choose colour (to show use of colour pickers from SG - RI ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾)
- choose shape (to show use of shaders from SG - RI ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾)
- countdown timer (to show use of SGXTimer)
- save and load presets (to show use of SGXFileSystem and SGXFile)
Next, we go to GitHub and use the GitHub UI to make a new repository, this is significantly easier than setting 1 up locally. Make sure that you do NOT add a README or a license or a .gitignore, since we will add these ourselves later.
In your computer file system, make a empty folder preferably named after the project, and use cmd (or terminal) to run
git clone https://github.com/[your GitHub username]/[repository name].git
For me, this would be
git clone https://github.com/InfinityIntegral/ColoursPlusPlus.git
This links the GitHub remote repository with the new folder that you just created. If this is successful, you should see a hidden folder called .git in the new folder.
If Git complains something about not being able to start a thread, restart (turn off then turn on) your Windows firewall and try again. If you do not have Git, install Git first.
If you are on Linux, replace the link with
git@github.com:[your GitHub username]/[repository name].git
to use SSH instead of HTTPS. This requires you to set up SSH access on your account first and is easier than trying to get Git Credential Manager to work on Linux.
We create a blank text file CMakeLists.txt in the new folder then open up Qt Creator.
On the top right corner of the Qt Creator welcome page, click "open project" and navigate to the new folder that you just created. Select the empty CMakeLists.txt file.
When asked to configure the project, choose a compiler and use the debug version of the kit. You cannot run a release build unless you copy paste the DLLs, which is annoying, so we will only do that at the end.
Now we have the Qt Creator project set up.
We can then write our .gitignore and License.txt
.gitignore tells GitHub which files should not be commited to the repository. These are automatically generated and do not contain any significant code. For SGEXTN projects, this is a safe default to copy.
build*/ fakeqml*/ *.o *.exe *.user *.pro.user *.qmake.stash *.autosave .DS_Store .qtcreator/*
The License.txt would depend on what license you want to use. For software that provide an existing feature (for example SGEXTN, because there are other C++ frameworks available), you should use the Lesser General Public License to encourage user adoption. For software that provide a new feature, such as _ocu_entation, the application processing .sgdoc files, use General Public License version 3 and later to promote open source software.
For the README, you can either leave it blank for now or write a placeholder one saying that this is a work in progress.
See here for the next part of the tutorial.
©2025 05524F.sg (Singapore)