TheNewGuy
17th December 2009, 03:44
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:
LHWidget1* ptr; // complains when LHWidget2 is passed
LHWidget2* ptr; // complains when LHWidget1 is passed
QWidget* ptr; // complains when either is passed
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:
LHWidget1* ptr; // complains when LHWidget2 is passed
LHWidget2* ptr; // complains when LHWidget1 is passed
QWidget* ptr; // complains when either is passed