Custom icon in tree view

Introduction
This is an example of dialog creation with PySide.

In this example, the entire interface is defined in Python. Although this is possible for small interfaces, for larger interfaces the recommendation is to create files through Qt Designer, and load these in the program. See Dialog creation with UI files.

Personalized icon in the combo view
Here an example to create an object with properties and icon personalised in ComboView

Download the example icon to the same directory as the macro

Use of an icon for three different use cases: icon_in_file_disk (format .png), icon_XPM_in_macro (format .XPM) and icon_resource_FreeCAD



Complete example creating a cube and its icon