i can generate the cpp code, but i can not compile it because i get the error
'PythonQtShell_MyClass' : cannot instantiate abstract class
I know what that mean but i don't know how i can add something to the typesystem-xml file, that will tell the generator that this class is not instantiable.
Can anybody give my some hint?
Thanks in advance
Tonka
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, PythonQt supports this and should automatically reimplement the abstract methods so that the shell class becomes creatable. Try reducing the number of abstract methods to a simple example and see if that works. I suspect that you have an abstract method that uses unknown types in its parameters. You can also have a look at the rejected methods (this is a text file that the generator creates), it will list all methods that were not wrapped.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've check the rejected methods file and i've see that there are some rejected methods. All rejected functions contains a std::unique_ptr<> (C++ 11) in the signature or in the return value.
the class (in my example MyClass) from std::unqiue_ptr is know by the typesystem and is not rejected and has no rejected methods.
Can i add std::unique_ptr to the typesystem?
Could it be that PythonQt generator could not handle std::unique_ptr that? If yes, is there any possiblity to get that working with the generator (by hand would be horrible, because i have hundreds of class with std::unique_ptr)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PythonQt does not support std::unique_ptr and this can not be added easily, since the semantics of std::unique_ptr would require that PythonQt holds the returned object as a std::unique_ptr, but PythonQt holds a normal pointer internally.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh, so there nothing i can do?
Technically it should be possible (you can make a ), but the actual generator could not handle that - is that correct?
Is this a problem from the Qt Jambi code?
It should be possible to generate a Wrapper class per template type f.e.
std::unique_ptr<MyClass> could get a wrapper class called f.e. MyClass_unique_ptr which only handle the std::unique_ptr itself, so the script engine gets these wrapper class. These soloution could work for most templates. Do you see any change to get this working with the QtJambi code?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey,
i've try to use the generator to generate a shell-class for a class which has partial pure virtual functions
f.e.
My problem: If i use
i can generate the cpp code, but i can not compile it because i get the error
I know what that mean but i don't know how i can add something to the typesystem-xml file, that will tell the generator that this class is not instantiable.
Can anybody give my some hint?
Thanks in advance
Tonka
Are your methods really private, or did you skip something? I think the abstract virtual functions need to be public or protected.
Ups, all methods are public, i've forget that line in my example.
Do you have a solution for my problem?
Well, PythonQt supports this and should automatically reimplement the abstract methods so that the shell class becomes creatable. Try reducing the number of abstract methods to a simple example and see if that works. I suspect that you have an abstract method that uses unknown types in its parameters. You can also have a look at the rejected methods (this is a text file that the generator creates), it will list all methods that were not wrapped.
I've check the rejected methods file and i've see that there are some rejected methods. All rejected functions contains a std::unique_ptr<> (C++ 11) in the signature or in the return value.
examples:
std::unique_ptr remove(int iIndex);
void add(std::unique_tr<MyClass>);
the class (in my example MyClass) from std::unqiue_ptr is know by the typesystem and is not rejected and has no rejected methods.
Can i add std::unique_ptr to the typesystem?
Could it be that PythonQt generator could not handle std::unique_ptr that? If yes, is there any possiblity to get that working with the generator (by hand would be horrible, because i have hundreds of class with std::unique_ptr)?
PythonQt does not support std::unique_ptr and this can not be added easily, since the semantics of std::unique_ptr would require that PythonQt holds the returned object as a std::unique_ptr, but PythonQt holds a normal pointer internally.
Oh, so there nothing i can do?
Technically it should be possible (you can make a ), but the actual generator could not handle that - is that correct?
Is this a problem from the Qt Jambi code?
It should be possible to generate a Wrapper class per template type f.e.
std::unique_ptr<MyClass> could get a wrapper class called f.e. MyClass_unique_ptr which only handle the std::unique_ptr itself, so the script engine gets these wrapper class. These soloution could work for most templates. Do you see any change to get this working with the QtJambi code?
No, I don't see how that could be done.
I will tinker a little bit and try to validate if could do that.
Do you accept patches? Is there any git repo (like guthub) instead of svn, because it would be much easier to support your project?
Nope, only svn, sorry. I accept patches.