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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtextformat.cpp -->
<title>Qt 4.8: QTextTableFormat Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QTextTableFormat</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QTextTableFormat Class Reference</h1>
<!-- $$$QTextTableFormat-brief -->
<p>The QTextTableFormat class provides formatting information for tables in a <a href="qtextdocument.html">QTextDocument</a>. <a href="#details">More...</a></p>
<!-- @@@QTextTableFormat -->
<pre class="cpp"> <span class="preprocessor">#include <QTextTableFormat></span></pre><p><b>Inherits: </b><a href="qtextframeformat.html">QTextFrameFormat</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qtexttableformat-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#QTextTableFormat">QTextTableFormat</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::Alignment </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#alignment">alignment</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#cellPadding">cellPadding</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#cellSpacing">cellSpacing</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#clearColumnWidthConstraints">clearColumnWidthConstraints</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVector<QTextLength> </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#columnWidthConstraints">columnWidthConstraints</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#columns">columns</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#headerRowCount">headerRowCount</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#setAlignment">setAlignment</a></b> ( Qt::Alignment <i>alignment</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#setCellPadding">setCellPadding</a></b> ( qreal <i>padding</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#setCellSpacing">setCellSpacing</a></b> ( qreal <i>spacing</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#setColumnWidthConstraints">setColumnWidthConstraints</a></b> ( const QVector<QTextLength> & <i>constraints</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtexttableformat.html#setHeaderRowCount">setHeaderRowCount</a></b> ( int <i>count</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qtextframeformat.html#public-functions">QTextFrameFormat</a></li>
<li class="fn">49 public functions inherited from <a href="qtextformat.html#public-functions">QTextFormat</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTextTableFormat-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QTextTableFormat class provides formatting information for tables in a <a href="qtextdocument.html">QTextDocument</a>.</p>
<p>A table is a group of cells ordered into rows and columns. Each table contains at least one row and one column. Each cell contains a block. Tables in rich text documents are formatted using the properties defined in this class.</p>
<p>Tables are horizontally justified within their parent frame according to the table's alignment. This can be read with the <a href="qtexttableformat.html#alignment">alignment</a>() function and set with <a href="qtexttableformat.html#setAlignment">setAlignment</a>().</p>
<p>Cells within the table are separated by cell spacing. The number of pixels between cells is set with <a href="qtexttableformat.html#setCellSpacing">setCellSpacing</a>() and read with <a href="qtexttableformat.html#cellSpacing">cellSpacing</a>(). The contents of each cell is surrounded by cell padding. The number of pixels between each cell edge and its contents is set with <a href="qtexttableformat.html#setCellPadding">setCellPadding</a>() and read with <a href="qtexttableformat.html#cellPadding">cellPadding</a>().</p>
<p class="centerAlign"><img src="images/qtexttableformat-cell.png" alt="" /></p><p>The table's background color can be read with the <a href="qtextformat.html#background">background</a>() function, and can be specified with <a href="qtextformat.html#setBackground">setBackground</a>(). The background color of each cell can be set independently, and will control the color of the cell within the padded area.</p>
<p>The table format also provides a way to constrain the widths of the columns in the table. Columns can be assigned a fixed width, a variable width, or a percentage of the available width (see <a href="qtextlength.html">QTextLength</a>). The <a href="qtexttableformat.html#columns">columns</a>() function returns the number of columns with constraints, and the <a href="qtexttableformat.html#columnWidthConstraints">columnWidthConstraints</a>() function returns the constraints defined for the table. These quantities can also be set by calling <a href="qtexttableformat.html#setColumnWidthConstraints">setColumnWidthConstraints</a>() with a vector containing new constraints. If no constraints are required, <a href="qtexttableformat.html#clearColumnWidthConstraints">clearColumnWidthConstraints</a>() can be used to remove them.</p>
</div>
<p><b>See also </b><a href="qtexttable.html">QTextTable</a>, <a href="qtexttablecell.html">QTextTableCell</a>, and <a href="qtextlength.html">QTextLength</a>.</p>
<!-- @@@QTextTableFormat -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextTableFormat[overload1]$$$QTextTableFormat -->
<h3 class="fn"><a name="QTextTableFormat"></a>QTextTableFormat::<span class="name">QTextTableFormat</span> ()</h3>
<p>Constructs a new table format object.</p>
<!-- @@@QTextTableFormat -->
<!-- $$$alignment[overload1]$$$alignment -->
<h3 class="fn"><a name="alignment"></a><span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> QTextTableFormat::<span class="name">alignment</span> () const</h3>
<p>Returns the table's alignment.</p>
<p><b>See also </b><a href="qtexttableformat.html#setAlignment">setAlignment</a>().</p>
<!-- @@@alignment -->
<!-- $$$cellPadding[overload1]$$$cellPadding -->
<h3 class="fn"><a name="cellPadding"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QTextTableFormat::<span class="name">cellPadding</span> () const</h3>
<p>Returns the table's cell padding. This describes the distance between the border of a cell and its contents.</p>
<p><b>See also </b><a href="qtexttableformat.html#setCellPadding">setCellPadding</a>().</p>
<!-- @@@cellPadding -->
<!-- $$$cellSpacing[overload1]$$$cellSpacing -->
<h3 class="fn"><a name="cellSpacing"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QTextTableFormat::<span class="name">cellSpacing</span> () const</h3>
<p>Returns the table's cell spacing. This describes the distance between adjacent cells.</p>
<p><b>See also </b><a href="qtexttableformat.html#setCellSpacing">setCellSpacing</a>().</p>
<!-- @@@cellSpacing -->
<!-- $$$clearColumnWidthConstraints[overload1]$$$clearColumnWidthConstraints -->
<h3 class="fn"><a name="clearColumnWidthConstraints"></a><span class="type">void</span> QTextTableFormat::<span class="name">clearColumnWidthConstraints</span> ()</h3>
<p>Clears the column width constraints for the table.</p>
<p><b>See also </b><a href="qtexttableformat.html#columnWidthConstraints">columnWidthConstraints</a>() and <a href="qtexttableformat.html#setColumnWidthConstraints">setColumnWidthConstraints</a>().</p>
<!-- @@@clearColumnWidthConstraints -->
<!-- $$$columnWidthConstraints[overload1]$$$columnWidthConstraints -->
<h3 class="fn"><a name="columnWidthConstraints"></a><span class="type"><a href="qvector.html">QVector</a></span><<span class="type"><a href="qtextlength.html">QTextLength</a></span>> QTextTableFormat::<span class="name">columnWidthConstraints</span> () const</h3>
<p>Returns a list of constraints used by this table format to control the appearance of columns in a table.</p>
<p><b>See also </b><a href="qtexttableformat.html#setColumnWidthConstraints">setColumnWidthConstraints</a>().</p>
<!-- @@@columnWidthConstraints -->
<!-- $$$columns[overload1]$$$columns -->
<h3 class="fn"><a name="columns"></a><span class="type">int</span> QTextTableFormat::<span class="name">columns</span> () const</h3>
<p>Returns the number of columns specified by the table format.</p>
<!-- @@@columns -->
<!-- $$$headerRowCount[overload1]$$$headerRowCount -->
<h3 class="fn"><a name="headerRowCount"></a><span class="type">int</span> QTextTableFormat::<span class="name">headerRowCount</span> () const</h3>
<p>Returns the number of rows in the table that define the header.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtexttableformat.html#setHeaderRowCount">setHeaderRowCount</a>().</p>
<!-- @@@headerRowCount -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QTextTableFormat::<span class="name">isValid</span> () const</h3>
<p>Returns true if this table format is valid; otherwise returns false.</p>
<!-- @@@isValid -->
<!-- $$$setAlignment[overload1]$$$setAlignmentQt::Alignment -->
<h3 class="fn"><a name="setAlignment"></a><span class="type">void</span> QTextTableFormat::<span class="name">setAlignment</span> ( <span class="type"><a href="qt.html#AlignmentFlag-enum">Qt::Alignment</a></span> <i>alignment</i> )</h3>
<p>Sets the table's <i>alignment</i>.</p>
<p><b>See also </b><a href="qtexttableformat.html#alignment">alignment</a>().</p>
<!-- @@@setAlignment -->
<!-- $$$setCellPadding[overload1]$$$setCellPaddingqreal -->
<h3 class="fn"><a name="setCellPadding"></a><span class="type">void</span> QTextTableFormat::<span class="name">setCellPadding</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>padding</i> )</h3>
<p>Sets the cell <i>padding</i> for the table. This determines the distance between the border of a cell and its contents.</p>
<p><b>See also </b><a href="qtexttableformat.html#cellPadding">cellPadding</a>().</p>
<!-- @@@setCellPadding -->
<!-- $$$setCellSpacing[overload1]$$$setCellSpacingqreal -->
<h3 class="fn"><a name="setCellSpacing"></a><span class="type">void</span> QTextTableFormat::<span class="name">setCellSpacing</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>spacing</i> )</h3>
<p>Sets the cell <i>spacing</i> for the table. This determines the distance between adjacent cells.</p>
<p><b>See also </b><a href="qtexttableformat.html#cellSpacing">cellSpacing</a>().</p>
<!-- @@@setCellSpacing -->
<!-- $$$setColumnWidthConstraints[overload1]$$$setColumnWidthConstraintsconstQVector<QTextLength>& -->
<h3 class="fn"><a name="setColumnWidthConstraints"></a><span class="type">void</span> QTextTableFormat::<span class="name">setColumnWidthConstraints</span> ( const <span class="type"><a href="qvector.html">QVector</a></span><<span class="type"><a href="qtextlength.html">QTextLength</a></span>> & <i>constraints</i> )</h3>
<p>Sets the column width <i>constraints</i> for the table.</p>
<p><b>See also </b><a href="qtexttableformat.html#columnWidthConstraints">columnWidthConstraints</a>() and <a href="qtexttableformat.html#clearColumnWidthConstraints">clearColumnWidthConstraints</a>().</p>
<!-- @@@setColumnWidthConstraints -->
<!-- $$$setHeaderRowCount[overload1]$$$setHeaderRowCountint -->
<h3 class="fn"><a name="setHeaderRowCount"></a><span class="type">void</span> QTextTableFormat::<span class="name">setHeaderRowCount</span> ( <span class="type">int</span> <i>count</i> )</h3>
<p>Declares the first <i>count</i> rows of the table as table header. The table header rows get repeated when a table is broken across a page boundary.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qtexttableformat.html#headerRowCount">headerRowCount</a>().</p>
<!-- @@@setHeaderRowCount -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|