Menu

Custom package name

Help
2015-11-12
2015-11-12
  • Joerg Kreuzberger

    Hi!

    I can register additional classes to be used from script by calling PythonQt::registerCPPClass with an individual package name.
    to load them in script i must call
    import PythonQt.<packagename>
    or
    from PythonQt.<packagename> import *

    Now i want to to configure that my package is in a different "main" package like
    import <myproduct>.<packagename>

    is this possible somehow with PythonQt?

    Intention is:
    the packages could be also released "standalone" by using swig. Then the package name handling should be the same or each time some scripts must be adapted....

     
  • Florian Link

    Florian Link - 2015-11-12

    You can use:

    PythonQt::priv()->registerCPPClass("ClassName", "ParentName", NULL, NULL, NULL, module)

    where module is a PyObject*.

    You have to take care of creating that module using the Python C-API yourself.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.