Calling the base class's implementation from the derived?

后端 未结 4 923
渐次进展
渐次进展 2021-01-20 15:02

I want to do what the base does, but then I want to add some derived stuff.

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

相关标签:
4条回答
  • 2021-01-20 15:09

    You were almost there, just one small syntax change.

    AguiWidget::onSizeChanged(size);
    
    0 讨论(0)
  • 2021-01-20 15:16

    Close.

    AguiWidget::onSizeChanged(size);
    
    0 讨论(0)
  • 2021-01-20 15:21

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

    0 讨论(0)
  • 2021-01-20 15:30

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

    0 讨论(0)
提交回复
热议问题