Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to call a member function of multiple objects just by 1 calling?
mohmo last edited by
I have a class named "myclass". This class has a member function : void func();
I make an array of objects on the heap:
myclass* cl=new myclass ;
I wanna call myclass::func() of all objects just by 1 time calling.
But when i define the function as STATIC,: static void func(); i encounter an error that the function has no static members. how can i solve the problem because i have update() (for QPainter) function in func() that can not be defined as static.
What is a remedy??
Thanks a lot.
You can't, you have to use a for or while loop to call your function on each object.