<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] > [官方代碼格式](https://wiki.qt.io/Qt_Coding_Style) ## 縮進 1. 4 個 spaces的縮進 2. Spaces, not tabs! ## 聲明變量 1. 每個變量一行 2. 避免簡短或無意義的名字 ``` // Wrong int a, b; char *c, *d; // Correct int height; int width; char *nameOfThis; char *nameOfThat; ``` 3. 變量和函數以小寫字母開頭。變量名稱中的每個連續單詞都以大寫字母開頭 ``` // Wrong short Cntr; char ITEM_DELIM = ' '; // Correct short counter; char itemDelimiter = ' '; ``` 4. 類以大寫字母開頭的大駝峰寫法 ## 空白 1. 在關鍵字之后和花括號之前總是使用一個空格 ``` // Wrong if(foo){ } // Correct if (foo) { } ``` 2. 對于指針或引用,總是在類型和'*'或'&'之間使用單個空格,但在'*'或'&'和變量名之間不使用空格 ``` char *x; const QString &myString; const char * const y = "hello"; ``` 3. 在每個逗號后面留一個空格 4. 盡可能避免c風格的類型轉換 ``` // Wrong char* blockOfMemory = (char* ) malloc(data.size()); // Correct char *blockOfMemory = reinterpret_cast<char *>(malloc(data.size())); ``` 5. 不要把多個語句放在一行上 ``` // Wrong if (foo) bar(); // Correct if (foo) bar(); ``` ## else 語句 ``` // Wrong if (codec) { } else { } // Correct if (codec) { } else { } ``` ## 條件語句體不止一行時菜使用大括號 ``` // Wrong if (address.isEmpty()) { return false; } for (int i = 0; i < 10; ++i) { qDebug("%i", i); } // Correct if (address.isEmpty()) return false; for (int i = 0; i < 10; ++i) qDebug("%i", i); ``` ## 表達式使用括號 ``` // Wrong if (a && b || c) // Correct if ((a && b) || c) // Wrong a + b & c // Correct (a + b) & c ``` ## 多條件 ``` // Wrong if (longExpression + otherLongExpression + otherOtherLongExpression) { } // Correct if (longExpression + otherLongExpression + otherOtherLongExpression) { } ```92
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看