Support LHWidget1 and LHWidget2 inherits from QWidget.

Now suppose LHWidget3 gets passed either LHWidget1 or LHWidget2. And a property of LHWIdget3 named ptr gets set to the either widget.

How would I do this? this is what I have tried:

Qt Code:
  1. LHWidget1* ptr; // complains when LHWidget2 is passed
  2. LHWidget2* ptr; // complains when LHWidget1 is passed
  3. QWidget* ptr; // complains when either is passed
To copy to clipboard, switch view to plain text mode