KeineAhnung
8th May 2014, 08:49
Hi,
I have a QList with a custom data type. All I found on filling the list looked like this:
customStruct newStruct;
newStruct.prperty1 = xy;
newStruct.prperty2 = xy;
newStruct.prperty3 = xy;
[...]
newStruct.prpertyN = xy;
list.append(newStruct);
Is there a more elegant way to do that? So that everything is on one line or maybe two? Or does one line only work if I create a new class?
I have a QList with a custom data type. All I found on filling the list looked like this:
customStruct newStruct;
newStruct.prperty1 = xy;
newStruct.prperty2 = xy;
newStruct.prperty3 = xy;
[...]
newStruct.prpertyN = xy;
list.append(newStruct);
Is there a more elegant way to do that? So that everything is on one line or maybe two? Or does one line only work if I create a new class?