Clarisse 5.0 SP8 SDK
5.0.5.8.0
|
This topic covers how to integrate PyQt or PySide widgets with Clarisse. Remember, Clarisse does not distribute a custom Python version. It uses the Python environment installed on your system. In order to use PyQt or PySide, you must install it on your system. Please refer to PyQt website http://www.riverbankcomputing.com/software/pyqt/intro for more information on how to install PyQt, and PySide webiste https://wiki.qt.io/PySide for PySide installation.
If you already tried to run a QApplication inside Clarisse, you may have noticed Clarisse application gets frozen. It's simple, when running the PyQt script blocks Clarisse's event loop. We provide a special helper to let you run your scripts in non-blocking mode. This file pyqt_clarisse.py
can be found in the python directory inside the Clarisse binary folder.
pyqt_clarisse.py
but it also handles PySideInstead of using the method QApplication::exec_
, Clarisse provides a method helper pyqt_clarisse.exec_
that must be used to run your script in a non-blocking fashion.
By default, command history is disabled when Clarisse is running a script. However, if the application isn't blocked by the execution of a script, it is best to reactivate command history. Failing to do so would disable Clarisse's undo system.
This is why pyqt_clarisse.exec_ forces the application to enable command history. That way, when an user modifies or creates items in Clarisse, proper commands are pushed to the application command stack even if the script is still running.
This also means that each time the running script modifies item attributes a command will be pushed. To avoid filling the command history, it's recommended to create a batch command. For more information please refer to Command History section.
If you are very careful, you can also disable command history prior modifying an item. To disable the application history you can call:
After your modifications, you can re-enable the command history by calling: