User Tools

Site Tools


Sidebar

Multimedia

k23:k23.3:start

23.3.0 Paint class (gb.qt4)

Drawing under Gambas with the Paint class (gb.qt4/5) has something of a technical drawing feel - of construction with compass and ruler, because it is not freehand drawing. Firstly, the essential properties of the Paint class are presented and then the methods are described and their effects for selected methods are commented on. The projects presented and their description take up a lot of space.

The results that can be achieved are illustrated by the example of Nelson Hoover's speedometer component:

Bild1

Figure 23.3.0.1: Speedometer and rev counter

or the GUI of a function plotter with interactive input of the function equation:

Bild2

Figure 23.3.0.2: Plotter

The image display with a magnifying glass function was developed by Fabien Bodard and only uses properties and methods of the Paint class:

Bild3

Figure 23.3.0.3: Image display with magnifying glass function

Drawing with the methods of the Paint class sets clear accents in the visualisation of numerical values:

Bild3

Figure 23.3.0.4: Bar chart

Please bear in mind that the QT4/5 toolkit is consistently used as the 'Graphical User Interface' in all projects in the Gambas book. The alternative use of the components gb.gtk or gb.gtk3 is usually possible, but unfortunately does not always lead to the same result. There are also dependencies on the desktop used - even if you do not use the gb.gui component. These dependencies also apply when using the Paint class. The Gambas developers are endeavouring to eliminate such incompatibilities - especially those between GTK and QT.

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k23/k23.3/start.txt · Last modified: 04.03.2024 by emma

Page Tools