i am writing an application where in class inherits from vector and qt widget class as well and in one of the questions when i call a function as this->size() compiler is throwing an error
ambigious function call,
i am giving an example.
class A:public std::vector<int>,public Qwidget
{
private :
public:
int getSize()
{ return this->size(); }
}
i know the problem is because of both vector and q
You need to explicitly qualify the call to size with the injected base class name that you actually want to refer to.
However, what you do is horribly evil.
std::vectoris not intended to be inherited from (and your code will never compile: it is a template). If you really need a sequence container with signal/slot shenanigans, you should use QList.