Calling an implementation of a base class from a derived?

I want to do what the base does, but then I want to add some derivative things.

I tried the following, but this did not work: (this function is virtual in AguiWidget)

void AguiLabel::onSizeChanged( const AguiSize &size )
{
    AguiWidget.onSizeChanged(size);
    updateLabel();
}

thank

+3
source share
4 answers

Change AguiWidget.onSizeChanged(size);to AguiWidget::onSizeChanged(size);.

+6
source

Use the scope operator ::(i.e. AguiWidget::onSizeChanged(size))

+2
source

, .

AguiWidget::onSizeChanged(size);
+2

To close.

AguiWidget::onSizeChanged(size);
+2
source

All Articles