
Originally Posted by
SixDegrees
Sorry, I misunderstood you. I though you have written that you were unable to put it in the "working" plugin. You have to put it there, it wouldn't make sense to put it elsewhere.
I suspect that the Qt framework only allows inheritance directly from the abstract base class. At least, that seems to be the case in practice, as noted.
"Qt framework" has nothing to do with this. C++ enforces some rules but it is perfectly valid to inherit from an implementation of a pure abstract class.
class Interface {
public:
virtual void func1() = 0;
virtual void func2() = 0;
};
class Implementation : public Interface {
public:
void func1() { printf("Implementation::func1();\n"); }
void func2() { printf("Implementation::func2();\n"); }
};
class Inherited : public Implementation {
public:
void func2() { printf("Inherited::func2();\n"); }
};
class Interface {
public:
virtual void func1() = 0;
virtual void func2() = 0;
};
class Implementation : public Interface {
public:
void func1() { printf("Implementation::func1();\n"); }
void func2() { printf("Implementation::func2();\n"); }
};
class Inherited : public Implementation {
public:
void func2() { printf("Inherited::func2();\n"); }
};
To copy to clipboard, switch view to plain text mode
You can do the same with Qt plugins, only that you have to remember you should inherit from QObject somewhere.
Bookmarks