class Widget{ .. } // Widget Class
class Interface { // pure virtual functions .. } // Interface class (Abstract Class)
class WidgetType1 : public Widget, public Interface { ... } // Type 1 Widget (ComboBox) inherits widget and Interface
class WidgetType2 : public Widget, public Interface { ... } // Type 2 Widget (LineEdit) inherits widget and Interface
Widget* widget = getWidget(...);
Interface* interface = dynamic_cast<Interface*> (widget); // Convert Widget to Interface
Widgetのオブジェクト(基本的にはWidgetType 1/2)のインターフェイスのメソッドにアクセスするにはどうすればよいですか
Widgetのポインタで参照されているWidgetType1のキャストオブジェクトを入力できません