We should have installed first:
- GNAT Ada compiler version FSF 12.1 or 14.2.
- Python version 3.7 or newer
Install Qt for Python
We install PySide 6 the official Python bindings for Qt under a user Python environment:
% cd $HOME
% python3 -m venv env
% source env/bin/activate
% pip3 install pyside6
% deactivate
Get QtAda6
% cd $HOME
% git clone https://github.com/Blady-Com/QtAda6.git
It tests if PySide is correctly installed:
% cd $HOME
% cd QtAda6
% gprbuild -P qtada6_tests.gpr -XTarget_OS=OSX test_01
% PYTHONPATH=$HOME/env/lib/python3.9/site-packages:$PWD/tests bin/test_01
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/lib/python3.9/config-3.9-darwin/
libpython3.9.dylib
*.dylib
Python version: 3.9.6 (default, May 7 2023, 23:32:45)
[Clang 14.0.3 (clang-1403.0.22.14.1)]
Python CWD: /Users/me/Documents/Programmation/Qt/QtAda6
PySide6 version: 6.7.0
Python Enum: 3
Python Enum: 2
Python Enum: 1
Python Enum: 2
<class 'NoneType'>
PCA.GA: 5
PCA.SQR: 25
PCA.VC: 150
PCB.GA: 12
PCB.SQR: 144
PCB.Super.GA: 10
PCB.Super.VC: 864
PCC.GA: 13
PCC.SQR: 169
PCC.VC: 1019
Exiting
Note: this is the command line and the result on macOS, change Target_OS with yours (see $HOME/QtAda6/simple_components/lib_components.gpr for possible values) and change PYTHONPATH to yours.
We can tell where is a specific Python library location with the Load procedure:
Py.Load ("Path/to/libpython");
It tests few QtCore API:
% cd $HOME
% cd QtAda6
% gprbuild -P qtada6_tests.gpr -XTarget_OS=OSX test_02
% PYTHONPATH=$HOME/env/lib/python3.9/site-packages bin/test_02
PySide version: 6.7.0
QtCore version: 6.7.0
Today: 29
Current folder: /Users/me/Documents/Programmation/Qt/QtAda6
Current machine: MicMac
HOME: /Users/me
DashDotLine: 4
Horizontal value: 1
Horizontal name: Python Enum: Horizontal
Horizontal or Vertical value: 3
Exiting
This program also shows the way of programing with QtAda6:
- initialize Python interpreter
- take the global interpreter lock
- initialize QtAda6
- declare QTAda6 objects and initialize them
- call QtAda6 API
- finalize QtAda6 objects
- finalize QtAda6
- finalize Python interpreter
It tests few QtGui API:
% cd $HOME
% cd QtAda6
% gprbuild -P qtada6_tests.gpr -XTarget_OS=OSX test_03
% PYTHONPATH=$HOME/env/lib/python3.9/site-packages bin/test_03
PySide version: 6.5.2
QtCore version: 6.5.2
0
Exiting
A GUI app with a graphic clock is launched:
It tests few QtWidgets API:
% cd $HOME
% cd QtAda6
% gprbuild -P qtada6_tests.gpr -XTarget_OS=OSX test_04
% PYTHONPATH=$HOME/env/lib/python3.9/site-packages bin/test_04
PySide version: 6.5.2
0
Exiting
A GUI app with widgets label and button is launched:
It displays environnement variables, current directory and command line arguments:
% cd $HOME
% cd QtAda6
% gprbuild -P qtada6_tests.gpr -XTarget_OS=OSX envdisplay
% PYTHONPATH=$HOME/env/lib/python3.9/site-packages bin/envdisplay
PySide version: 6.5.2
Warning: Not-supported role (13)
Warning: Not-supported role (6)
Warning: Not-supported role (7)
...
0
Exiting
A GUI app with several widgets is launched:
This is the very first release whose goal is mostly to get feedbacks on how it is usable or if the class hierarchy is as user friendly as C++ version.
Known limitations are :
- Only QtCore, QtGui and QtWidgets are provided
- Signal, composed types, multi-inheritance and so on are not or partially translated
- Class inheritance is not fully available on Ada side (a workaround call Python code)
- No memory management
Post your feedbacks on QtAda6 GitHub issues.
- Simple Components are written by Dmitry A. Kazakov (www.dmitry-kazakov.de/ada/components.htm). Licence: GPLv2 with generics exception.
- UXStrings are written by Pascal Pignard (github.com/Blady-Com/UXStrings). Licence: CeCILL-C.
- QtAda6 bindings have been generated from Qt for Python (www.qt.io/qt-for-python). Licence: LGPLv3/GPLv3.
QtAda6 is free software released under CeCILL-C V2.1.
Pascal Pignard, September-November 2023, January-July 2024, June 2025.


