PySide/es

Introduction
PySide es un enlace Python del conjunto de herramientas GUI multiplataforma Qt. FreeCAD utiliza PySide para todos los fines de la GUI (interfaz de usuario gráfica) dentro de Python. PySide es una alternativa al paquete PyQt que fue utilizado anteriormente por FreeCAD para su GUI. PySide tiene una licencia más permisible. Ver Differences Between PySide and PyQt Para más información sobre las diferencias.

PySide in FreeCAD with Qt5
FreeCAD was developed to be used with Python 2 and Qt4. As these two libraries became obsolete, FreeCAD transitioned to Python 3 and Qt5. In most cases this transition was done without needing to break backwards compatibility.

Normally, the module provides support for Qt4, while  provides support for Qt5. However, in FreeCAD, there is no need to use directly, as a special  module is included to handle Qt5.

This module is located in the  directory of an installation of FreeCAD compiled for Qt5.

This module just imports the necessary classes from, but places them in the namespace. This means that in most cases the same code can be used with both Qt4 and Qt5, as long as it imports.

The only unusual aspect is that the classes are placed in the  namespace.

PySide information
Los usuarios de FreeCAD a menudo logran todo usando la interfaz integrada. Pero para los usuarios que desean personalizar sus operaciones, existe la interfaz de Python que se documenta en el Python Scripting Tutorial. La interfaz de Python para FreeCAD tenía una gran flexibilidad y potencia. Para su interacción con el usuario, Python con FreeCAD utiliza PySide, que es lo que se documenta en esta página.

Python ofrece la declaración de "print" que proporciona el código:

Con la declaración de impresión de Python, solo tiene un control limitado de la apariencia y el comportamiento. PySide proporciona el control faltante y también maneja entornos (como el entorno de archivos de macros FreeCAD) donde las instalaciones integradas de Python no son suficientes.

Las habilidades de PySide van desde:



hasta:



Familiarize yourself with some real-world examples of PySide
 * PySide Beginner Examples (Hello World, announcements, enter text, enter number)
 * PySide Intermediate Examples (window sizing, hiding widgets, popup menus, mouse position, mouse events)
 * PySide Advanced Examples (widgets etc.)

They divide the subject matter into 3 parts, differentiated by level of exposure to PySide, Python and the FreeCAD internals. The first page has overview and background material giving a description of PySide and how it is put together while the second and third pages are mostly code examples at different levels.

The intention is that the associated pages will provide simple Python code to run PySide so that the user working on a problem can easily copy the code, paste it into their own work, adapt it as necessary and return to their problem solving with FreeCAD. Hopefully they don't have to go chasing off across the internet looking for answers to PySide questions. At the same time this page is not intended to replace the various comprehensive PySide tutorials and reference sites available on the web.