Solved Pass different classes to QSharedPointer?
-
Howdy y'all, been reading the QT docs for the past hour and don't see if this is possible. I have 2 classes named Object1 and Object2, is it possible to pass each class to just 1 method with a QSharedPointer parameter?
What I'm coding:
void getData(QSharedPointer<???> object) <-- ??? is where I'm trying to pass both Object1 first and when that completes pass Object2 { .... }
Thanks for any help and/or tips you provide. Much appreciated.
-
Hi,
You can make your function a templated function.
-
@SGaist Thanks for the reply. Never did that before, more reading I'm guessing.
-
@SGaist Googling for some good examples currently. Any chance you have a sample code to share? Thanks
-
template <class T> void getData(QSharedPointer<T> object) { .... }
-
Appreciate the help, thank you both. That worked