如何以双引号打破一条线
How to break a long line in double quotes?
本文关键字:一条 更新时间:2023-10-16
例如,在我的C 代码中:
setStyleSheet
(
"QPushButton{background-color:#9dce2c; border-radius:7px; border:1px solid #83c41a; color:#000000; font-size:15px; font-weight:bold; padding:4px 24px; text-decoration:none; }"
"QPushButton:pressed { border:2px; solid black; }"
"QPushButton:hover { background-color:grey; }"
"QPushButton:focus { outline: none; }"
"QGroupBox { font-size:15px; font-weight:bold; padding:6px 0px; text-decoration:underline; }"
);
有什么想法?
c和c 自动加入相邻字符串文字,因此您可以做
setStyleSheet
(
"QPushButton{background-color:#9dce2c; border-radius:7px;"
" border:1px solid #83c41a; color:#000000; font-size:15px;"
" font-weight:bold; padding:4px 24px; text-decoration:none; }"
// ...
);
它将按预期工作。(这里没有必要的凹痕,但我认为表明这里的第二和第三行是第一个的连续性是很好的。)
布莱恩(Brian您需要相应地移动报价。...
setStyleSheet
(
"QPushButton{background-color:#9dce2c; border-radius:7px; "
"border:1px solid #83c41a; color:#000000; font-size:15px; "
"font-weight:bold; padding:4px 24px; text-decoration:none; }"
"QPushButton:pressed { border:2px; solid black; }"
"QPushButton:hover { background-color:grey; }"
"QPushButton:focus { outline: none; }"
"QGroupBox { font-size:15px; font-weight:bold; padding:6px 0px; "
"text-decoration:underline; }"
);
(如果要易于阅读的输出,则可以用n"
结束行以注入新线。)
相关文章:
- 如何在 c++ 中确定一条指令(以字节为单位)在哪里结束,另一条指令从哪里开始?
- 如何在 Win32 中用一条线连接 2 个文本框?
- C++ 如何在同一行中和在一条线上?
- 如何在SDL2窗口上使用Cairo绘制一条白色直线
- 在Opengl中绘制一条不显示C++的线
- 为什么当 while 循环中的 if 条件变为 false 时,我的函数不输出最后一条语句?
- x86 - 为什么编译器在下一条指令中插入看似毫无意义的JMP?
- CMake似乎忽略了一条线
- 在C 中使用Legacy OpenGL(即时模式)绘制一条厚线
- 在图像标签上画一条线并计算距离
- switch 语句结束和下一条语句之间的时间是否具有确定性(与路径无关)
- 如何在OMNET++中收到来自前一个模块的所有消息后将一条消息发送到下一个模块
- 一条线和两行声明之间的差异
- C++ OpenCV:检测两条线而不是一条线(Canny & findContours)
- 如何在C++中将边列表转换为邻接矩阵,其中包含连接到顶点的边数而不是一条边?
- 为什么 fstream 打印出文件的最后一条记录
- 如何在另一条消息(M1)之前调用带有消息(M2)的lambda函数,但输出要"M2 M1"?
- 如何在子小部件而不是父窗口小部件上绘制一条线
- 在C++中,文件中的下一条记录被非法更新
- MFC:在 CRichEditCtrl 中突出显示一条线一段时间,然后恢复