先说代码质量,仅供参考,不过我觉得有一定道理:
① Use multi-arg instead
【不要使用一连串的 arg().arg().arg() 了】
QString("%1 %2").arg(a).arg(b); // Bad
QString("%1 %2").arg(a, b); // one less temporary heap allocation
这个不一定好使,以前用过报错。
② parameter 'list' is passed by value and only copied once;
consider moving it to avoid unnecessary copies