<div dir="ltr">Dear folks<div><br></div><div>Rule 1.12 says:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>The incompleteness of split lines must be made obvious.</div><div><div><br></div></div><div><div>Split lines occurs when a statement exceed the 80 column limit given above.</div></div><div><div>It is difficult to give rigid rules for how lines should be split, but the examples above should give a general hint.</div></div><div><div><br></div></div><div><div>In general:</div></div></blockquote><div><div><ul><ul><li>Break after a comma.</li><li>Break after an operator.</li><li>Align the new line with the beginning of the expression on the previous line.</li></ul></ul></div></div><div><br></div><div><br></div><div>I'm curious how to format the following snippet: (for this example, let's suppose it doesn't fit in the line width limit)</div><div><br></div><div><div><font face="monospace, monospace">return QString("%1:%2:%3)</font></div><div><font face="monospace, monospace">       .arg(localTime->tm_hour, 2, 10, '0')</font></div><div><font face="monospace, monospace">       .arg(localTime->tm_min, 2, 10, '0')</font></div><div><font face="monospace, monospace">       .arg(localTime->tm_sec, 2, 10, '0');</font></div></div><div><br></div><div>Technically ')' is an operator so I can break after it, but this doesn't make the incompleteness obvious.</div><div><br></div><div><br></div><div>If I break after the dot operator, the snippet becomes:</div><div><br></div><div><div><font face="monospace, monospace">return QString("%1:%2:%3).</font></div><div><font face="monospace, monospace">         arg(localTime->tm_hour, 2, 10, '0').</font></div><div><font face="monospace, monospace">         arg(localTime->tm_min, 2, 10, '0').</font></div><div><font face="monospace, monospace">         arg(localTime->tm_sec, 2, 10, '0');</font></div></div><div><br></div><div>but the bare "arg" in the front doesn't look good.<br></div><div><br></div><div><br></div><div>If I break after the '(' operator, the snippet becomes:</div><div><br></div><div><div><font face="monospace, monospace">return QString("%1:%2:%3).</font><span style="font-family:monospace,monospace">arg(</span></div><div><span style="font-family:monospace,monospace">         localTime->tm_hour, 2, 10, '0').</span><span style="font-family:monospace,monospace">arg(</span></div><div><span style="font-family:monospace,monospace">         localTime->tm_min, 2, 10, '0').</span><span style="font-family:monospace,monospace">arg(</span></div><div><span style="font-family:monospace,monospace">         localTime->tm_sec, 2, 10, '0');</span></div></div><div><br></div><div>but this is also weird.<br></div><div><br></div><div><br></div><div>If I break after the comma, the snippet becomes:<br></div><div><br></div><div><div><font face="monospace, monospace">return QString("%1:%2:%3)</font><span style="font-family:monospace,monospace">.arg(localTime->tm_hour,</span></div><div><span style="font-family:monospace,monospace">                              2, 10, '0')</span><span style="font-family:monospace,monospace">.arg(localTime->tm_min,</span></div><div><span style="font-family:monospace,monospace">                                              2, 10, '0')</span><span style="font-family:monospace,monospace">.arg(localTime->tm_sec,</span></div><div><span style="font-family:monospace,monospace">                                                              2, 10, '0');</span></div></div><div><br></div><div>which looks even worse.</div><div><br></div><div><br></div><div>Yours, Junxiao</div></div>