C++ (Qt)struct A { virtual void Test( const QRect & ) { qDebug() << "A::QRect"; } virtual void Test( const QSize & ) { qDebug() << "A::QSize"; }}; struct B : public A { virtual void Test( const QRect & ) { qDebug() << "B::QRect"; }};
#include <iostream>using namespace std;struct A { virtual void Test(int i) { cout << "Test A int " << i; } virtual void Test() { cout << "Test A"; }}; struct B : public A { using A::Test; virtual void Test() { cout << "Test B"; }};int main(){ B bb; bb.Test(5); return 0;}
C++ (Qt)#include <QSize>#include <QRect>#include <QDebug> struct A { virtual void Test( const QRect & ) { qDebug() << "A::QRect"; } virtual void Test( const QSize & ) { qDebug() << "A::QSize"; }}; struct B : public A { virtual void Test( const QRect &r ) { qDebug() << "B::QRect"; A::Test( r ); }}; int main(int , char *[]){ A a; a.Test( QSize() ); a.Test( QRect() ); B b; b.Test( QSize() ); b.Test( QRect() ); return 0;}