例如,如果我有:
QTextDocument* pDocument = mpTextEdit->document();
QTextCursor cursor(pDocument);
QFont defaultFont("Calibri", 12);
pDocument->setDefaultFont(defaultFont);
QString str = "<h1>Hello, World!</h1>
str += "<br/>";
str += QString("名称不能为空。");
str += "<br/>";
str += "ABC";
str += "</p>";
pDocument->setHtml(str);
// Print to .pdf
QPrinter printer(QPrinter::PrinterResolution);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setPaperSize(QPrinter::A4);
printer.setOutputFileName("c:/temp/foo.pdf");
printer.setFontEmbeddingEnabled(true);
pDocument->setPageSize(printer.pageRect().size());
pDocument->print(&printer);
假设blockquote是文字代码块的一部分。有没有办法表明这些是单独的块?
答案 0 :(得分:1)
.. code:: python
import os
this_is_the_last_code_line = 5
.. pull-quote::
Now I want this text to be a blockquote.