Import 2017-06-07 23:51:09: master ba7c3782

Author Committer Branch Timestamp Parent
mwoehlke mwoehlke master 2014-05-30 18:43:25 master da227822
Changeset

ENH: Add support for real Qt resources in Python

Add methods to qSlicerCoreApplication to allow Python code to invoke the
raw data overloads of QResource::[un]registerResource (which otherwise
cannot be invoked, as the requisite uchar* overloads are hidden by the
QString overloads). Create a Python script to generate a Python compiled
resource script (similar to pyrcc4 or pyside-rcc, except leveraging Qt's
native rcc rather than reimplementing it). Create CMake functions to
invoke this in an appropriate manner, and to create necessary target
dependencies so that the resulting Python files are created before the
ctkFunctionAddCompilePythonScriptTargets targets try to copy them to
their final build locations.

This system will allow Python loadable modules to use Qt resources by
creating a .qrc file and loading the resources using ':/path' notation,
in the same manner as C++ code (rather than individually copying every
resource file and loading them relative to the module's directory).

git-svn-id: http://svn.slicer.org/Slicer4/trunk@23290 3bd1e089-480b-0410-8dfb-8563597acbee

mod - Base/QTCore/qSlicerCoreApplication.cxx Diff File
mod - Base/QTCore/qSlicerCoreApplication.h Diff File
mod - Base/QTCore/qSlicerCoreApplication_p.h Diff File
add - CMake/SlicerFunctionAddPythonQtResources.cmake Diff File
mod - CMake/UseSlicer.cmake.in Diff File
mod - CMakeLists.txt Diff File
add - Utilities/Scripts/qrcc.py Diff File