QList<QPushButton *> to QList<QWidget *> impossible
-
Hello everyone !
I'm facing a problem with my project :(
I have a class "ElementArbo" which inherits QPushButton, and in this class I have a member QList<ElementAbo*>.
I need to send this list to animate my buttons via another class "Animateur" which have 2 methods :static void translation(QWidget * const & objet, QPoint posDepart, QPoint posArrivee, int duree); static void translationMultiple(QList<QWidget * const> &objets, QList<QPoint> &posDepart, QList<QPoint> &posArrivee, QList<int> &duree);
When I want to do a simple translation and send one element of my list, it works well. But when I send my list it says that "No known conversion for argument 1 from 'QList<ElementArbo*>' to 'QList<QWidget* const>&"
I have tried a dynamic_cast but it doesn't work.If someone has a clue, I'll take it :)
Thank you !
-
@Amott
Hi!
This will not work.QList<QWidget *>
andQList<ElementArbo*>
are two completely different (and unrelated classes) so there's no way you will be able to convert them like this. You can convert the elements (even without the dynamic cast) but the lists ... not happening.Kind regards.