Skip to content
  • mwoehlke's avatar
    ENH: Add support for real Qt resources in Python · ba7c3782
    mwoehlke authored
    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
    ba7c3782