Input values ββto custom class with "<<"
I am new to C ++ and I am trying to figure out how to do the following:
I have a class that contains a QList. I am trying to populate a QList as shown below. I am wondering how can I achieve this? Is this done in the NumberList constructor? I used to populate myList using a method that takes a list of objects and retrieves them to populate a QList, but that won't work for my example below.
NumberList myList; myList << 1 << 2 << 3;
+3
source share