Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qtcreator中的长Qstring_Qt_Ide_Mingw - Fatal编程技术网

Qtcreator中的长Qstring

Qtcreator中的长Qstring,qt,ide,mingw,Qt,Ide,Mingw,当我在qtcreator中输入多行代码时,我有很长的Qstring(html代码) 我出错了,她就是我出错的代码,那么最好的方法是什么 Qstring在多行中无错误 html += "<!doctype html> <html> <head> <style type="text/css"> html, body { margin: a

当我在qtcreator中输入多行代码时,我有很长的Qstring(html代码)

我出错了,她就是我出错的代码,那么最好的方法是什么

Qstring在多行中无错误

html +=   "<!doctype html>
        <html>
            <head>
                <style type="text/css">
        html, body {
            margin: auto;
        }
        #container {
            margin-top: 41px;
            margin-left: 61px;
            margin-right: 61px;
        }
        #logo {
            text-align: center;
        }
        #client li,#entreprise li {
            text-decoration: none;
            list-style: none;
            font-size: 16px;
            margin-bottom: 6px;
        }
        #facture_num {
            text-align: center;
            font-weight: bold;
            font-family: arial;
            font-size: 21px;
            margin-top: 30px;
            margin-bottom: 30px;
        }
        #client {
            float: right;
            width: 500px;
            margin-right: 260px;
            margin-bottom: 30px;
            margin-top: -12px;
        }
        table {
            width: 1000px;
        }
        table td {
            text-align: center;
        }
        table th {
            background: #ccc;
        }

                </style>
            </head>
            <body>
        <div id="container">
                    <!-- Header of facture -->
                <div id="logo">
                    <h1>Logo d'entreprise</h1>
                </div>

                <ul id="entreprise">
                    <li>N° RC: 23131313213213132</li>
                <li>N° CF : 556465465456456456</li>

                <li></li></ul>
                <div id="facture_num">Factrue N°:...........</div>
                <ul id="client">
                    <li>Client:</li>
                        <li>N° rc: 23131313213213132</li>
                <li>N° cf : 556465465456456456</li>
                <li></li>
                </ul>
                <br>
                <br>
                <!-- body of facture -->
                <table>
                    <thead>
                        <tr>
                            <th>N°</th>
                            <th>Désignation</th>
                            <th>Qte</th>
                            <th>Prix Unitaire</th>
                            <th>Montant</th>
                        </tr>
                    </thead>

                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>
                    <tr>
                        <td>1</td>
                        <td>2</td>
                        <td>3</td>
                        <td>4</td>
                    </tr>

                    <tfoot>
                        <tr>
                            <td></td>
                        </tr>
                    </tfoot>
                </table>
                <!-- footer of facture -->
        </div>
            </body>
        </html>";
html+=”
html,正文{
保证金:自动;
}
#容器{
利润率最高:41px;
左边距:61px;
右边距:61px;
}
#标志{
文本对齐:居中;
}
#客户李#企业李{
文字装饰:无;
列表样式:无;
字体大小:16px;
边缘底部:6px;
}
#断裂数{
文本对齐:居中;
字体大小:粗体;
字体系列:arial;
字号:21px;
边缘顶部:30px;
边缘底部:30px;
}
#客户{
浮动:对;
宽度:500px;
右边距:260px;
边缘底部:30px;
边缘顶部:-12px;
}
桌子{
宽度:1000px;
}
表td{
文本对齐:居中;
}
表th{
背景:#ccc;
}
企业标志
  • 编号:231313213132
  • 编号:556465465456456456456
事实,事实。。。。。。。。。。。
  • 客户:
  • 编号:231313213132
  • 编号:556465465456456456456


N° 签名 Qte 统一大奖赛 蒙坦特 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. 1. 2. 3. 4. ";
字符串在第一个引号处断开:

像这样逃避:

 <style type=\"text/css\">

这是一种方法

您需要对字符串中的每个引号执行此操作

你还需要逃离马车

在每行末尾添加\项


或者,您可以用“结束每一行,并用带引号的“

”开始下一行。以及其他地方。。。逃离他们。好吧,只有这条路??当我们有300行或更多行时,我们能做什么?好的,很好,我会尝试这种方式,它看起来更好