Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2876

feature request: add a way to expose to python functions of sub classes as main class

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • None
    • Shiboken
    • None

    Description

      Currently there is no way to expose to python a functions of sub / helper(object private) classes as if they were their own.
      We use many such structs / classes to 'group' variables / functions in order to help manage things (some are thread safe, some are not, etc)
      for now the only way that i know of is to create a wrapper function manually in the c code (but that would ruin our code structure and mislead)

      code example:

      class NBrokerAccountShared {
      private:
      	friend class NBrokerAccount;
      	NBrokerAccountShared(){}
      public:
      	void otherFunc(){}
      }
      
      class NBrokerAccount{
      public:
      	NBrokerAccount() : mSharedData(new NBrokerAccountShared() {}
      	void someFunction(){}
      private:
      	std::unique_ptr<NBrokerAccountShared> mSharedData;
      }
      

      xml:

      <object-type name="NBrokerAccount">
      </object-type>
      

      i would like to have 'someFunction' and 'otherFunc' as if they were part of 'NBrokerAccount' while 'NBrokerAccountShared' should stay invisible to the python (generate=false)
      i dont know whats the best way to achieve this
      via add-function tags with some 'getter' param(NBrokerAccountShared::mSharedData)?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            meomic Michal M
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes