1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QTextBlockFormat Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QTextBlockFormat Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTextBlockFormat class provides formatting information for blocks of text in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>
<p>Inherits <a href="qtextformat.html">QTextFormat</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtextblockformat.html#QTextBlockFormat">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#QTextBlockFormat-2">__init__</a></b> (<i>self</i>, QTextBlockFormat)</li><li><div class="fn" />Qt.Alignment <b><a href="qtextblockformat.html#alignment">alignment</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextblockformat.html#bottomMargin">bottomMargin</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qtextblockformat.html#indent">indent</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextblockformat.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextblockformat.html#leftMargin">leftMargin</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qtextblockformat.html#nonBreakableLines">nonBreakableLines</a></b> (<i>self</i>)</li><li><div class="fn" />QTextFormat.PageBreakFlags <b><a href="qtextblockformat.html#pageBreakPolicy">pageBreakPolicy</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextblockformat.html#rightMargin">rightMargin</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setAlignment">setAlignment</a></b> (<i>self</i>, Qt.Alignment)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setIndent">setIndent</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a></b> (<i>self</i>, bool)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setPageBreakPolicy">setPageBreakPolicy</a></b> (<i>self</i>, QTextFormat.PageBreakFlags)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setRightMargin">setRightMargin</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setTabPositions">setTabPositions</a></b> (<i>self</i>, list-of-QTextOption.Tab)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setTextIndent">setTextIndent</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setTopMargin">setTopMargin</a></b> (<i>self</i>, float)</li><li><div class="fn" />list-of-QTextOption.Tab <b><a href="qtextblockformat.html#tabPositions">tabPositions</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextblockformat.html#textIndent">textIndent</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qtextblockformat.html#topMargin">topMargin</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTextBlockFormat class provides formatting information for blocks of text in a <a href="qtextdocument.html">QTextDocument</a>.</p>
<p>A document is composed of a list of blocks, represented by <a href="qtextblock.html">QTextBlock</a> objects. Each block can contain an item of some kind, such as a paragraph of text, a table, a list, or an image. Every block has an associated QTextBlockFormat that specifies its characteristics.</p>
<p>To cater for left-to-right and right-to-left languages you can set a block's direction with setDirection(). Paragraph alignment is set with <a href="qtextblockformat.html#setAlignment">setAlignment</a>(). Margins are controlled by <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>(). Overall indentation is set with <a href="qtextblockformat.html#setIndent">setIndent</a>(), the indentation of the first line with <a href="qtextblockformat.html#setTextIndent">setTextIndent</a>().</p>
<p>Line breaking can be enabled and disabled with <a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a>().</p>
<p>The brush used to paint the paragraph's background is set with <a href="qtextformat.html#setBackground">setBackground()</a>, and other aspects of the text's appearance can be customized by using the <a href="qtextformat.html#setProperty">setProperty()</a> function with the <tt>OutlinePen</tt>, <tt>ForegroundBrush</tt>, and <tt>BackgroundBrush</tt> <a href="qtextformat.html#Property-enum">QTextFormat.Property</a> values.</p>
<p>If a text block is part of a list, it can also have a list format that is accessible with the listFormat() function.</p>
<p>See also <a href="qtextblock.html">QTextBlock</a> and <a href="qtextcharformat.html">QTextCharFormat</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTextBlockFormat" />QTextBlockFormat.__init__ (<i>self</i>)</h3><p>Constructs a new <a href="qtextblockformat.html">QTextBlockFormat</a>.</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/alignment" />
<h3 class="fn"><a name="QTextBlockFormat-2" />QTextBlockFormat.__init__ (<i>self</i>, <a href="qtextblockformat.html">QTextBlockFormat</a>)</h3><h3 class="fn"><a name="alignment" /><a href="qt-alignment.html">Qt.Alignment</a> QTextBlockFormat.alignment (<i>self</i>)</h3><p>Returns the paragraph's alignment.</p>
<p>See also <a href="qtextblockformat.html#setAlignment">setAlignment</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/bottomMargin" />
<h3 class="fn"><a name="bottomMargin" />float QTextBlockFormat.bottomMargin (<i>self</i>)</h3><p>Returns the paragraph's bottom margin.</p>
<p>See also <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>() and <a href="qtextblockformat.html#topMargin">topMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/indent" />
<h3 class="fn"><a name="indent" />int QTextBlockFormat.indent (<i>self</i>)</h3><p>Returns the paragraph's indent.</p>
<p>See also <a href="qtextblockformat.html#setIndent">setIndent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/isValid" />
<h3 class="fn"><a name="isValid" />bool QTextBlockFormat.isValid (<i>self</i>)</h3><p>Returns true if this block format is valid; otherwise returns false.</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/leftMargin" />
<h3 class="fn"><a name="leftMargin" />float QTextBlockFormat.leftMargin (<i>self</i>)</h3><p>Returns the paragraph's left margin.</p>
<p>See also <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#rightMargin">rightMargin</a>(), and <a href="qtextblockformat.html#indent">indent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/nonBreakableLines" />
<h3 class="fn"><a name="nonBreakableLines" />bool QTextBlockFormat.nonBreakableLines (<i>self</i>)</h3><p>Returns true if the lines in the paragraph are non-breakable; otherwise returns false.</p>
<p>See also <a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/pageBreakPolicy" />
<h3 class="fn"><a name="pageBreakPolicy" /><a href="qtextformat-pagebreakflags.html">QTextFormat.PageBreakFlags</a> QTextBlockFormat.pageBreakPolicy (<i>self</i>)</h3><p>Returns the currently set page break policy for the paragraph. The default is <a href="qtextformat.html#PageBreakFlag-enum">QTextFormat.PageBreak_Auto</a>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextblockformat.html#setPageBreakPolicy">setPageBreakPolicy</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/rightMargin" />
<h3 class="fn"><a name="rightMargin" />float QTextBlockFormat.rightMargin (<i>self</i>)</h3><p>Returns the paragraph's right margin.</p>
<p>See also <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>() and <a href="qtextblockformat.html#leftMargin">leftMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setAlignment" />
<h3 class="fn"><a name="setAlignment" />QTextBlockFormat.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>)</h3><p>Sets the paragraph's <i>alignment</i>.</p>
<p>See also <a href="qtextblockformat.html#alignment">alignment</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setBottomMargin" />
<h3 class="fn"><a name="setBottomMargin" />QTextBlockFormat.setBottomMargin (<i>self</i>, float)</h3><p>Sets the paragraph's bottom <i>margin</i>.</p>
<p>See also <a href="qtextblockformat.html#bottomMargin">bottomMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), and <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setIndent" />
<h3 class="fn"><a name="setIndent" />QTextBlockFormat.setIndent (<i>self</i>, int)</h3><p>Sets the paragraph's <i>indentation</i>. Margins are set independently of indentation with <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>() and <a href="qtextblockformat.html#setTextIndent">setTextIndent</a>(). The <i>indentation</i> is an integer that is multiplied with the document-wide standard indent, resulting in the actual indent of the paragraph.</p>
<p>See also <a href="qtextblockformat.html#indent">indent</a>() and <a href="qtextdocument.html#indentWidth-prop">QTextDocument.indentWidth</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setLeftMargin" />
<h3 class="fn"><a name="setLeftMargin" />QTextBlockFormat.setLeftMargin (<i>self</i>, float)</h3><p>Sets the paragraph's left <i>margin</i>. Indentation can be applied separately with <a href="qtextblockformat.html#setIndent">setIndent</a>().</p>
<p>See also <a href="qtextblockformat.html#leftMargin">leftMargin</a>(), <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), and <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setNonBreakableLines" />
<h3 class="fn"><a name="setNonBreakableLines" />QTextBlockFormat.setNonBreakableLines (<i>self</i>, bool)</h3><p>If <i>b</i> is true, the lines in the paragraph are treated as non-breakable; otherwise they are breakable.</p>
<p>See also <a href="qtextblockformat.html#nonBreakableLines">nonBreakableLines</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setPageBreakPolicy" />
<h3 class="fn"><a name="setPageBreakPolicy" />QTextBlockFormat.setPageBreakPolicy (<i>self</i>, <a href="qtextformat-pagebreakflags.html">QTextFormat.PageBreakFlags</a>)</h3><p>Sets the page break policy for the paragraph to <i>policy</i>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextblockformat.html#pageBreakPolicy">pageBreakPolicy</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setRightMargin" />
<h3 class="fn"><a name="setRightMargin" />QTextBlockFormat.setRightMargin (<i>self</i>, float)</h3><p>Sets the paragraph's right <i>margin</i>.</p>
<p>See also <a href="qtextblockformat.html#rightMargin">rightMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), and <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setTabPositions" />
<h3 class="fn"><a name="setTabPositions" />QTextBlockFormat.setTabPositions (<i>self</i>, list-of-QTextOption.Tab)</h3><p>Sets the tab positions for the text block to those specified by <i>tabs</i>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtextblockformat.html#tabPositions">tabPositions</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setTextIndent" />
<h3 class="fn"><a name="setTextIndent" />QTextBlockFormat.setTextIndent (<i>self</i>, float)</h3><p>Sets the <i>indent</i> for the first line in the block. This allows the first line of a paragraph to be indented differently to the other lines, enhancing the readability of the text.</p>
<p>See also <a href="qtextblockformat.html#textIndent">textIndent</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>(), <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>(), and <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/setTopMargin" />
<h3 class="fn"><a name="setTopMargin" />QTextBlockFormat.setTopMargin (<i>self</i>, float)</h3><p>Sets the paragraph's top <i>margin</i>.</p>
<p>See also <a href="qtextblockformat.html#topMargin">topMargin</a>(), <a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a>(), <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>(), and <a href="qtextblockformat.html#setRightMargin">setRightMargin</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/tabPositions" />
<h3 class="fn"><a name="tabPositions" />list-of-QTextOption.Tab QTextBlockFormat.tabPositions (<i>self</i>)</h3><p>Returns a list of tab positions defined for the text block.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtextblockformat.html#setTabPositions">setTabPositions</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/textIndent" />
<h3 class="fn"><a name="textIndent" />float QTextBlockFormat.textIndent (<i>self</i>)</h3><p>Returns the paragraph's text indent.</p>
<p>See also <a href="qtextblockformat.html#setTextIndent">setTextIndent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBlockFormat/topMargin" />
<h3 class="fn"><a name="topMargin" />float QTextBlockFormat.topMargin (<i>self</i>)</h3><p>Returns the paragraph's top margin.</p>
<p>See also <a href="qtextblockformat.html#setTopMargin">setTopMargin</a>() and <a href="qtextblockformat.html#bottomMargin">bottomMargin</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.2</td></tr></table></div></address></body></html>
|