ce_nort
14th April 2016, 15:38
Newbie understanding question. I'm using QStringList as an example, but it's kind of a general question.
If I have a QStringList that I want to populate, I can do:
QStringList myList;
myList << "String1" << "String2";
Or I can do:
QStringList myList;
myList.append("String1");
myList.append("String2");
Obviously the first one is more concise, but is there any behind the scenes benefit to one approach or the other? When would I use one vs the other and why?
If I have a QStringList that I want to populate, I can do:
QStringList myList;
myList << "String1" << "String2";
Or I can do:
QStringList myList;
myList.append("String1");
myList.append("String2");
Obviously the first one is more concise, but is there any behind the scenes benefit to one approach or the other? When would I use one vs the other and why?