File: qtextblockformat.html

package info (click to toggle)
python-qt4 4.0.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 18,632 kB
  • ctags: 2,639
  • sloc: python: 29,409; sh: 5,646; cpp: 3,168; xml: 149; makefile: 109
file content (51 lines) | stat: -rw-r--r-- 12,236 bytes parent folder | download
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
<?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">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <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" />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&#160;<i>aalignment</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setBottomMargin">setBottomMargin</a></b> (<i>self</i>, float&#160;<i>margin</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setIndent">setIndent</a></b> (<i>self</i>, int&#160;<i>aindent</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a></b> (<i>self</i>, float&#160;<i>margin</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setNonBreakableLines">setNonBreakableLines</a></b> (<i>self</i>, bool&#160;<i>b</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setRightMargin">setRightMargin</a></b> (<i>self</i>, float&#160;<i>margin</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setTextIndent">setTextIndent</a></b> (<i>self</i>, float&#160;<i>margin</i>)</li><li><div class="fn" /><b><a href="qtextblockformat.html#setTopMargin">setTopMargin</a></b> (<i>self</i>, float&#160;<i>margin</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. 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="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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<h3 class="fn"><a name="setAlignment" />QTextBlockFormat.setAlignment (<i>self</i>, <a href="qt-alignment.html">Qt.Alignment</a>&#160;<i>aalignment</i>)</h3><p>Sets the paragraph's <i>alignment</i>.</p>
<p>See also <a href="qtextblockformat.html#alignment">alignment</a>().</p>
<h3 class="fn"><a name="setBottomMargin" />QTextBlockFormat.setBottomMargin (<i>self</i>, float&#160;<i>margin</i>)</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>
<h3 class="fn"><a name="setIndent" />QTextBlockFormat.setIndent (<i>self</i>, int&#160;<i>aindent</i>)</h3><p>Sets the paragraph's <i>indentation</i>. Margins are set independently of indentation with <a href="qtextblockformat.html#setLeftMargin">setLeftMargin</a>() and setTextIdent().</p>
<p>See also <a href="qtextblockformat.html#indent">indent</a>().</p>
<h3 class="fn"><a name="setLeftMargin" />QTextBlockFormat.setLeftMargin (<i>self</i>, float&#160;<i>margin</i>)</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>
<h3 class="fn"><a name="setNonBreakableLines" />QTextBlockFormat.setNonBreakableLines (<i>self</i>, bool&#160;<i>b</i>)</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>
<h3 class="fn"><a name="setRightMargin" />QTextBlockFormat.setRightMargin (<i>self</i>, float&#160;<i>margin</i>)</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>
<h3 class="fn"><a name="setTextIndent" />QTextBlockFormat.setTextIndent (<i>self</i>, float&#160;<i>margin</i>)</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>
<h3 class="fn"><a name="setTopMargin" />QTextBlockFormat.setTopMargin (<i>self</i>, float&#160;<i>margin</i>)</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>
<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>
<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>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt&#160;4.0.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.trolltech.com">Trolltech&#160;AS</a> 2006</td><td align="right" width="25%">Qt&#160;4.1.4</td></tr></table></div></address></body></html>