我正在阅读avio.h(ffmpeg的一部分),并且有这样的定义(?):
int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);.
我不明白.有人能解释一下这是做什么的吗?谢谢.
我正在编写简单的编辑器,我使用 QTextEdit 进行文本编辑 QSyntaxHighlighter 进行语法着色。样式由 QTextCharFormat 应用。
我知道如何创建简单的样式,例如:
keyword_format = QtGui.QTextCharFormat()
keyword_format.setForeground(QtCore.Qt.darkMagenta)
keyword_format.setFontWeight(QtGui.QFont.Bold)
exception_format = QtGui.QTextCharFormat()
exception_format.setForeground(QtCore.Qt.darkBlue)
exception_format.setFontWeight(QtGui.QFont.Italic)
Run Code Online (Sandbox Code Playgroud)
但是当选择文本时如何改变颜色并且:
我不知道我是否解释得足够清楚,例如我有代码
if foobar:
return foobar:
else:
raise Exception('foobar not set')
Run Code Online (Sandbox Code Playgroud)
现在,if、else、return和raise是关键字,并使用 进行格式化keyword_format,Exception使用 进行格式化exception_format。如果我选择文本,raise Exception('foobar not set')我想更改raise关键字,例如绿色、Exception粉色,并保留其余选择不变。