Menu

07. GUI

Rhett

It was necessary to find a new GUI library that supported z-ordering between sibling widgets. The choice fell on Qt.

Qt has the following benefits:

  1. Has the vital functions raise(), lower() and stackUnder().

  2. Is supported on all major platforms, i.e. on Linux, macOS, Windows, Andriod and iOS. In practice this means that the same source code can be run on all the platforms, given that the platform has a C++ compiler.

  3. Good documentation and knowledge base.

  4. A polished and professional product.

The last point is also a small minus. Qt is a professional company that needs to earn money. This means that restrictions may be put on the use of their software. Qt is (partly) open source and the libraries can (basically) be freely distributed. It may be necessary to contact Qt to ensure that their software may be distributed for an
application like this.


Downloading, compiling and setting up Qt was done like this.

The zip-file downloaded was qtbase-everywhere-src-6.5.2.zip found
here.

Here is given the outline of necessary steps for configuration and compiling.

$ mkdir qt-build
$ cd qt-build`

These were the configure options I used:

$ ../configure -prefix /opt/Qt6.5 -xcb -xcb-xlib -bundled-xcb-xinput -xkbcommon -no-feature-printsupport 
-no-feature-testlib -no-feature-dbus -no-feature-sql -no-feature-network -no-feature-wizard 
-no-feature-undocommand -no-feature-undogroup -no-feature-undostack -no-feature-undoview -no-feature-columnview 
-no-feature-concatenatetablesproxymodel -no-feature-datawidgetmapper -no-feature-identityproxymodel 
-no-feature-itemmodel -no-feature-itemviews -no-feature-listview -no-feature-proxymodel 
-no-feature-sortfilterproxymodel -no-feature-standarditemmodel -no-feature-stringlistmodel -no-feature-tableview 
-no-feature-transposeproxymodel -no-feature-treeview

Note the -xcb -xcb-xlib -bundled-xcb-xinput options. These build the vital xcb plugin (libqxcb.so).

It is necessary to do some pre-installation of libs:

sudo apt-get install libx11-*
sudo apt-get install libx11*

sudo apt-get install libxcb-*
sudo apt-get install libxcb*

sudo apt-get install libxkbcommon-dev
sudo apt-get install libxkbcommon-x11-dev

See also this:

sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev

The option -prefix /opt/Qt6.5 tells where to install the libraries.

$ cmake --build . --parallel
$ sudo cmake --install .

In the configuration many unnecessary features were turned off. Yet the compiled code swelled to 1,9 GB for some reason. But fortunately when you install the libraries they are only a few MB.

libQt6Core.so.6.5.2         6,9 MB
libQt6Gui.so.6.5.2          9,7 MB
libQt6Widgets.so.6.5.2      7,1 MB

The installed Qt6.5 libraries were then [link to old code deleted] to rewrite the code in [link to old code deleted]. The functionality is the same, only the GUI library is different. Note that a dragged counter will now always be placed on top of other counters, which is what one intuitively should expect.

screen


[Build links deleted]