You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
608 lines
37 KiB
608 lines
37 KiB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qheader.cpp:135 -->
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>TQHeader Class</title>
|
|
<style type="text/css"><!--
|
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
|
a:link { color: #004faf; text-decoration: none }
|
|
a:visited { color: #672967; text-decoration: none }
|
|
body { background: #ffffff; color: black; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr bgcolor="#E5E5E5">
|
|
<td valign=center>
|
|
<a href="index.html">
|
|
<font color="#004faf">Home</font></a>
|
|
| <a href="classes.html">
|
|
<font color="#004faf">All Classes</font></a>
|
|
| <a href="mainclasses.html">
|
|
<font color="#004faf">Main Classes</font></a>
|
|
| <a href="annotated.html">
|
|
<font color="#004faf">Annotated</font></a>
|
|
| <a href="groups.html">
|
|
<font color="#004faf">Grouped Classes</font></a>
|
|
| <a href="functions.html">
|
|
<font color="#004faf">Functions</font></a>
|
|
</td>
|
|
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQHeader Class Reference</h1>
|
|
|
|
<p>The TQHeader class provides a header row or column, e.g. for
|
|
tables and listviews.
|
|
<a href="#details">More...</a>
|
|
<p><tt>#include <<a href="qheader-h.html">qheader.h</a>></tt>
|
|
<p>Inherits <a href="qwidget.html">TQWidget</a>.
|
|
<p><a href="qheader-members.html">List of all member functions.</a>
|
|
<h2>Public Members</h2>
|
|
<ul>
|
|
<li class=fn><a href="#TQHeader"><b>TQHeader</b></a> ( TQWidget * parent = 0, const char * name = 0 )</li>
|
|
<li class=fn><a href="#TQHeader-2"><b>TQHeader</b></a> ( int n, TQWidget * parent = 0, const char * name = 0 )</li>
|
|
<li class=fn><a href="#~TQHeader"><b>~TQHeader</b></a> ()</li>
|
|
<li class=fn>int <a href="#addLabel"><b>addLabel</b></a> ( const TQString & s, int size = -1 )</li>
|
|
<li class=fn>int <a href="#addLabel-2"><b>addLabel</b></a> ( const TQIconSet & iconset, const TQString & s, int size = -1 )</li>
|
|
<li class=fn>void <a href="#removeLabel"><b>removeLabel</b></a> ( int section )</li>
|
|
<li class=fn>virtual void <a href="#setLabel"><b>setLabel</b></a> ( int section, const TQString & s, int size = -1 )</li>
|
|
<li class=fn>virtual void <a href="#setLabel-2"><b>setLabel</b></a> ( int section, const TQIconSet & iconset, const TQString & s, int size = -1 )</li>
|
|
<li class=fn>TQString <a href="#label"><b>label</b></a> ( int section ) const</li>
|
|
<li class=fn>TQIconSet * <a href="#iconSet"><b>iconSet</b></a> ( int section ) const</li>
|
|
<li class=fn>virtual void <a href="#setOrientation"><b>setOrientation</b></a> ( Orientation )</li>
|
|
<li class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</li>
|
|
<li class=fn>virtual void <a href="#setTracking"><b>setTracking</b></a> ( bool enable )</li>
|
|
<li class=fn>bool <a href="#tracking"><b>tracking</b></a> () const</li>
|
|
<li class=fn>virtual void <a href="#setClickEnabled"><b>setClickEnabled</b></a> ( bool enable, int section = -1 )</li>
|
|
<li class=fn>virtual void <a href="#setResizeEnabled"><b>setResizeEnabled</b></a> ( bool enable, int section = -1 )</li>
|
|
<li class=fn>virtual void <a href="#setMovingEnabled"><b>setMovingEnabled</b></a> ( bool )</li>
|
|
<li class=fn>virtual void <a href="#setStretchEnabled"><b>setStretchEnabled</b></a> ( bool b, int section )</li>
|
|
<li class=fn>void <a href="#setStretchEnabled-2"><b>setStretchEnabled</b></a> ( bool b )</li>
|
|
<li class=fn>bool <a href="#isClickEnabled"><b>isClickEnabled</b></a> ( int section = -1 ) const</li>
|
|
<li class=fn>bool <a href="#isResizeEnabled"><b>isResizeEnabled</b></a> ( int section = -1 ) const</li>
|
|
<li class=fn>bool <a href="#isMovingEnabled"><b>isMovingEnabled</b></a> () const</li>
|
|
<li class=fn>bool <a href="#isStretchEnabled"><b>isStretchEnabled</b></a> () const</li>
|
|
<li class=fn>bool <a href="#isStretchEnabled-2"><b>isStretchEnabled</b></a> ( int section ) const</li>
|
|
<li class=fn>void <a href="#resizeSection"><b>resizeSection</b></a> ( int section, int s )</li>
|
|
<li class=fn>int <a href="#sectionSize"><b>sectionSize</b></a> ( int section ) const</li>
|
|
<li class=fn>int <a href="#sectionPos"><b>sectionPos</b></a> ( int section ) const</li>
|
|
<li class=fn>int <a href="#sectionAt"><b>sectionAt</b></a> ( int pos ) const</li>
|
|
<li class=fn>int <a href="#count"><b>count</b></a> () const</li>
|
|
<li class=fn>int <a href="#headerWidth"><b>headerWidth</b></a> () const</li>
|
|
<li class=fn>TQRect <a href="#sectionRect"><b>sectionRect</b></a> ( int section ) const</li>
|
|
<li class=fn>virtual void setCellSize ( int section, int s ) <em>(obsolete)</em></li>
|
|
<li class=fn>int cellSize ( int i ) const <em>(obsolete)</em></li>
|
|
<li class=fn>int cellPos ( int i ) const <em>(obsolete)</em></li>
|
|
<li class=fn>int cellAt ( int pos ) const <em>(obsolete)</em></li>
|
|
<li class=fn>int <a href="#offset"><b>offset</b></a> () const</li>
|
|
<li class=fn>int <a href="#mapToSection"><b>mapToSection</b></a> ( int index ) const</li>
|
|
<li class=fn>int <a href="#mapToIndex"><b>mapToIndex</b></a> ( int section ) const</li>
|
|
<li class=fn>int mapToLogical ( int a ) const <em>(obsolete)</em></li>
|
|
<li class=fn>int mapToActual ( int l ) const <em>(obsolete)</em></li>
|
|
<li class=fn>void <a href="#moveSection"><b>moveSection</b></a> ( int section, int toIndex )</li>
|
|
<li class=fn>virtual void moveCell ( int fromIdx, int toIdx ) <em>(obsolete)</em></li>
|
|
<li class=fn>void setSortIndicator ( int section, bool ascending = TRUE ) <em>(obsolete)</em></li>
|
|
<li class=fn>void <a href="#setSortIndicator"><b>setSortIndicator</b></a> ( int section, SortOrder order )</li>
|
|
<li class=fn>int <a href="#sortIndicatorSection"><b>sortIndicatorSection</b></a> () const</li>
|
|
<li class=fn>SortOrder <a href="#sortIndicatorOrder"><b>sortIndicatorOrder</b></a> () const</li>
|
|
<li class=fn>void <a href="#adjustHeaderSize"><b>adjustHeaderSize</b></a> ()</li>
|
|
</ul>
|
|
<h2>Public Slots</h2>
|
|
<ul>
|
|
<li class=fn>virtual void <a href="#setOffset"><b>setOffset</b></a> ( int pos )</li>
|
|
</ul>
|
|
<h2>Signals</h2>
|
|
<ul>
|
|
<li class=fn>void <a href="#clicked"><b>clicked</b></a> ( int section )</li>
|
|
<li class=fn>void <a href="#pressed"><b>pressed</b></a> ( int section )</li>
|
|
<li class=fn>void <a href="#released"><b>released</b></a> ( int section )</li>
|
|
<li class=fn>void <a href="#sizeChange"><b>sizeChange</b></a> ( int section, int oldSize, int newSize )</li>
|
|
<li class=fn>void <a href="#indexChange"><b>indexChange</b></a> ( int section, int fromIndex, int toIndex )</li>
|
|
<li class=fn>void sectionClicked ( int index ) <em>(obsolete)</em></li>
|
|
<li class=fn>void moved ( int fromIndex, int toIndex ) <em>(obsolete)</em></li>
|
|
<li class=fn>void <a href="#sectionHandleDoubleClicked"><b>sectionHandleDoubleClicked</b></a> ( int section )</li>
|
|
</ul>
|
|
<h2>Properties</h2>
|
|
<ul>
|
|
<li class=fn>int <a href="#count-prop"><b>count</b></a> - the number of sections in the header <em>(read only)</em></li>
|
|
<li class=fn>bool <a href="#moving-prop"><b>moving</b></a> - whether the header sections can be moved</li>
|
|
<li class=fn>int <a href="#offset-prop"><b>offset</b></a> - the header's left-most (or top-most) visible pixel</li>
|
|
<li class=fn>Orientation <a href="#orientation-prop"><b>orientation</b></a> - the header's orientation</li>
|
|
<li class=fn>bool <a href="#stretching-prop"><b>stretching</b></a> - whether the header sections always take up the full width (or height) of the header</li>
|
|
<li class=fn>bool <a href="#tracking-prop"><b>tracking</b></a> - whether the sizeChange() signal is emitted continuously</li>
|
|
</ul>
|
|
<h2>Protected Members</h2>
|
|
<ul>
|
|
<li class=fn>TQRect <a href="#sRect"><b>sRect</b></a> ( int index )</li>
|
|
<li class=fn>virtual void <a href="#paintSection"><b>paintSection</b></a> ( TQPainter * p, int index, const TQRect & fr )</li>
|
|
<li class=fn>virtual void <a href="#paintSectionLabel"><b>paintSectionLabel</b></a> ( TQPainter * p, int index, const TQRect & fr )</li>
|
|
</ul>
|
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
|
|
|
|
|
The TQHeader class provides a header row or column, e.g. for
|
|
tables and listviews.
|
|
<p>
|
|
<p> This class provides a header, e.g. a vertical header to display
|
|
row labels, or a horizontal header to display column labels. It is
|
|
used by <a href="qtable.html">TQTable</a> and <a href="qlistview.html">TQListView</a> for example.
|
|
<p> A header is composed of one or more <em>sections</em>, each of which can
|
|
display a text label and an <a href="qiconset.html">iconset</a>. A sort
|
|
indicator (an arrow) can also be displayed using
|
|
<a href="#setSortIndicator">setSortIndicator</a>().
|
|
<p> Sections are added with <a href="#addLabel">addLabel</a>() and removed with <a href="#removeLabel">removeLabel</a>().
|
|
The label and iconset are set in addLabel() and can be changed
|
|
later with <a href="#setLabel">setLabel</a>(). Use <a href="#count">count</a>() to retrieve the number of
|
|
sections in the header.
|
|
<p> The orientation of the header is set with <a href="#setOrientation">setOrientation</a>(). If
|
|
<a href="#setStretchEnabled">setStretchEnabled</a>() is TRUE, the sections will expand to take up
|
|
the full width (height for vertical headers) of the header. The
|
|
user can resize the sections manually if <a href="#setResizeEnabled">setResizeEnabled</a>() is
|
|
TRUE. Call <a href="#adjustHeaderSize">adjustHeaderSize</a>() to have the sections resize to
|
|
occupy the full width (or height).
|
|
<p> A section can be moved with <a href="#moveSection">moveSection</a>(). If <a href="#setMovingEnabled">setMovingEnabled</a>()
|
|
is TRUE (the default)the user may drag a section from one position
|
|
to another. If a section is moved, the index positions at which
|
|
sections were added (with <a href="#addLabel">addLabel</a>()), may not be the same after the
|
|
move. You don't have to worry about this in practice because the
|
|
TQHeader API works in terms of section numbers, so it doesn't matter
|
|
where a particular section has been moved to.
|
|
<p> If you want the current index position of a section call
|
|
<a href="#mapToIndex">mapToIndex</a>() giving it the section number. (This is the number
|
|
returned by the addLabel() call which created the section.) If you
|
|
want to get the section number of a section at a particular index
|
|
position call <a href="#mapToSection">mapToSection</a>() giving it the index number.
|
|
<p> Here's an example to clarify mapToSection() and mapToIndex():
|
|
<p> <center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top" colspan="4" rowspan="1"> Index positions
|
|
<tr bgcolor="#f0f0f0"> <td valign="top">0 <td valign="top">1 <td valign="top">2 <td valign="top">3
|
|
<tr bgcolor="#a2c511"> <th valign="top" colspan="4" rowspan="1"> Original section ordering
|
|
<tr bgcolor="#d0d0d0"> <td valign="top">Sect 0 <td valign="top">Sect 1 <td valign="top">Sect 2 <td valign="top">Sect 3
|
|
<tr bgcolor="#a2c511"> <th valign="top" colspan="4" rowspan="1"> Ordering after the user moves a section
|
|
<tr bgcolor="#f0f0f0"> <td valign="top">Sect 0 <td valign="top">Sect 2 <td valign="top">Sect 3 <td valign="top">Sect 1
|
|
</table></center>
|
|
<p> <center><table cellpadding="4" cellspacing="2" border="0">
|
|
<tr bgcolor="#a2c511"> <th valign="top"><em>k</em> <th valign="top">mapToSection(<em>k</em>) <th valign="top">mapToIndex(<em>k</em>)
|
|
<tr bgcolor="#d0d0d0"> <td valign="top">0 <td valign="top">0 <td valign="top">0
|
|
<tr bgcolor="#f0f0f0"> <td valign="top">1 <td valign="top">2 <td valign="top">3
|
|
<tr bgcolor="#d0d0d0"> <td valign="top">2 <td valign="top">3 <td valign="top">1
|
|
<tr bgcolor="#f0f0f0"> <td valign="top">3 <td valign="top">1 <td valign="top">2
|
|
</table></center>
|
|
<p> In the example above, if we wanted to find out which section is at
|
|
index position 3 we'd call <a href="#mapToSection">mapToSection</a>(3) and get a section
|
|
number of 1 since section 1 was moved. Similarly, if we wanted to
|
|
know which index position section 2 occupied we'd call
|
|
<a href="#mapToIndex">mapToIndex</a>(2) and get an index of 1.
|
|
<p> TQHeader provides the <a href="#clicked">clicked</a>(), <a href="#pressed">pressed</a>() and <a href="#released">released</a>() signals.
|
|
If the user changes the size of a section, the <a href="#sizeChange">sizeChange</a>() signal
|
|
is emitted. If you want to have a sizeChange() signal emitted
|
|
continuously whilst the user is resizing (rather than just after
|
|
the resizing is finished), use <a href="#setTracking">setTracking</a>(). If the user moves a
|
|
section the <a href="#indexChange">indexChange</a>() signal is emitted.
|
|
<p> <img src=qheader-m.png> <img src=qheader-w.png>
|
|
<p> <p>See also <a href="qlistview.html">TQListView</a>, <a href="qtable.html">TQTable</a>, and <a href="advanced.html">Advanced Widgets</a>.
|
|
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<h3 class=fn><a name="TQHeader"></a>TQHeader::TQHeader ( <a href="qwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )
|
|
</h3>
|
|
Constructs a horizontal header called <em>name</em>, with parent <em>parent</em>.
|
|
|
|
<h3 class=fn><a name="TQHeader-2"></a>TQHeader::TQHeader ( int n, <a href="qwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )
|
|
</h3>
|
|
Constructs a horizontal header called <em>name</em>, with <em>n</em> sections
|
|
and parent <em>parent</em>.
|
|
|
|
<h3 class=fn><a name="~TQHeader"></a>TQHeader::~TQHeader ()
|
|
</h3>
|
|
Destroys the header and all its sections.
|
|
|
|
<h3 class=fn>int <a name="addLabel"></a>TQHeader::addLabel ( const <a href="qstring.html">TQString</a> & s, int size = -1 )
|
|
</h3>
|
|
Adds a new section with label text <em>s</em>. Returns the index
|
|
position where the section was added (at the right for horizontal
|
|
headers, at the bottom for vertical headers). The section's width
|
|
is set to <em>size</em>. If <em>size</em> < 0, an appropriate size for the
|
|
text <em>s</em> is chosen.
|
|
|
|
<h3 class=fn>int <a name="addLabel-2"></a>TQHeader::addLabel ( const <a href="qiconset.html">TQIconSet</a> & iconset, const <a href="qstring.html">TQString</a> & s, int size = -1 )
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> Adds a new section with iconset <em>iconset</em> and label text <em>s</em>.
|
|
Returns the index position where the section was added (at the
|
|
right for horizontal headers, at the bottom for vertical headers).
|
|
The section's width is set to <em>size</em>, unless size is negative in
|
|
which case the size is calculated taking account of the size of
|
|
the text.
|
|
|
|
<h3 class=fn>void <a name="adjustHeaderSize"></a>TQHeader::adjustHeaderSize ()
|
|
</h3>
|
|
|
|
<p> Adjusts the size of the sections to fit the size of the header as
|
|
completely as possible. Only sections for which <a href="#isStretchEnabled">isStretchEnabled</a>()
|
|
is TRUE will be resized.
|
|
|
|
<h3 class=fn>int <a name="cellAt"></a>TQHeader::cellAt ( int pos ) const
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#sectionAt">sectionAt</a>() instead.
|
|
<p> Returns the index at which the section is displayed, which contains
|
|
<em>pos</em> in widget coordinates, or -1 if <em>pos</em> is outside the header
|
|
sections.
|
|
|
|
<h3 class=fn>int <a name="cellPos"></a>TQHeader::cellPos ( int i ) const
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#sectionPos">sectionPos</a>() instead.
|
|
<p> Returns the position in pixels of the section that is displayed at the
|
|
index <em>i</em>. The position is measured from the start of the header.
|
|
|
|
<h3 class=fn>int <a name="cellSize"></a>TQHeader::cellSize ( int i ) const
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#sectionSize">sectionSize</a>() instead.
|
|
<p> Returns the size in pixels of the section that is displayed at
|
|
the index <em>i</em>.
|
|
|
|
<h3 class=fn>void <a name="clicked"></a>TQHeader::clicked ( int section )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<p> If <a href="#isClickEnabled">isClickEnabled</a>() is TRUE, this signal is emitted when the user
|
|
clicks section <em>section</em>.
|
|
<p> <p>See also <a href="#pressed">pressed</a>() and <a href="#released">released</a>().
|
|
|
|
<h3 class=fn>int <a name="count"></a>TQHeader::count () const
|
|
</h3><p>Returns the number of sections in the header.
|
|
See the <a href="qheader.html#count-prop">"count"</a> property for details.
|
|
<h3 class=fn>int <a name="headerWidth"></a>TQHeader::headerWidth () const
|
|
</h3>
|
|
Returns the total width of all the header columns.
|
|
|
|
<h3 class=fn><a href="qiconset.html">TQIconSet</a> * <a name="iconSet"></a>TQHeader::iconSet ( int section ) const
|
|
</h3>
|
|
Returns the icon set for section <em>section</em>. If the section does
|
|
not exist, 0 is returned.
|
|
|
|
<h3 class=fn>void <a name="indexChange"></a>TQHeader::indexChange ( int section, int fromIndex, int toIndex )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<p> This signal is emitted when the user moves section <em>section</em> from
|
|
index position <em>fromIndex</em>, to index position <em>toIndex</em>.
|
|
|
|
<h3 class=fn>bool <a name="isClickEnabled"></a>TQHeader::isClickEnabled ( int section = -1 ) const
|
|
</h3>
|
|
Returns TRUE if section <em>section</em> is clickable; otherwise returns
|
|
FALSE.
|
|
<p> If <em>section</em> is out of range (negative or larger than <a href="#count">count</a>() -
|
|
1): returns TRUE if all sections are clickable; otherwise returns
|
|
FALSE.
|
|
<p> <p>See also <a href="#setClickEnabled">setClickEnabled</a>().
|
|
|
|
<h3 class=fn>bool <a name="isMovingEnabled"></a>TQHeader::isMovingEnabled () const
|
|
</h3><p>Returns TRUE if the header sections can be moved; otherwise returns FALSE.
|
|
See the <a href="qheader.html#moving-prop">"moving"</a> property for details.
|
|
<h3 class=fn>bool <a name="isResizeEnabled"></a>TQHeader::isResizeEnabled ( int section = -1 ) const
|
|
</h3>
|
|
Returns TRUE if section <em>section</em> is resizeable; otherwise
|
|
returns FALSE.
|
|
<p> If <em>section</em> is -1 then this function applies to all sections,
|
|
i.e. returns TRUE if all sections are resizeable; otherwise
|
|
returns FALSE.
|
|
<p> <p>See also <a href="#setResizeEnabled">setResizeEnabled</a>().
|
|
|
|
<h3 class=fn>bool <a name="isStretchEnabled"></a>TQHeader::isStretchEnabled () const
|
|
</h3><p>Returns TRUE if the header sections always take up the full width (or height) of the header; otherwise returns FALSE.
|
|
See the <a href="qheader.html#stretching-prop">"stretching"</a> property for details.
|
|
<h3 class=fn>bool <a name="isStretchEnabled-2"></a>TQHeader::isStretchEnabled ( int section ) const
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> Returns TRUE if section <em>section</em> will resize to take up the full
|
|
width (or height) of the header; otherwise returns FALSE. If at
|
|
least one section has stretch enabled the sections will always
|
|
take up the full width of the header.
|
|
<p> <p>See also <a href="#setStretchEnabled">setStretchEnabled</a>().
|
|
|
|
<h3 class=fn><a href="qstring.html">TQString</a> <a name="label"></a>TQHeader::label ( int section ) const
|
|
</h3>
|
|
Returns the text for section <em>section</em>. If the section does not
|
|
exist, a <a href="qstring.html#TQString-null">TQString::null</a> is returned.
|
|
|
|
<p>Example: <a href="helpsystem-example.html#x2674">helpsystem/tooltip.cpp</a>.
|
|
<h3 class=fn>int <a name="mapToActual"></a>TQHeader::mapToActual ( int l ) const
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#mapToIndex">mapToIndex</a>() instead.
|
|
<p> Translates from logical index <em>l</em> to actual index (index at which the section <em>l</em> is displayed) .
|
|
Returns -1 if <em>l</em> is outside the legal range.
|
|
<p> <p>See also <a href="#mapToLogical">mapToLogical</a>().
|
|
|
|
<h3 class=fn>int <a name="mapToIndex"></a>TQHeader::mapToIndex ( int section ) const
|
|
</h3>
|
|
Returns the index position corresponding to the specified <em>section</em> number.
|
|
<p> <b>Warning:</b> If <a href="qtable.html">TQTable</a> is used to move header sections as a result of user
|
|
interaction, the mapping exposed by this function will not reflect the
|
|
order of the headers in the table; i.e., TQTable does not call <a href="#moveSection">moveSection</a>()
|
|
to move sections but handles move operations internally.
|
|
<p> <p>See also <a href="#mapToSection">mapToSection</a>().
|
|
|
|
<h3 class=fn>int <a name="mapToLogical"></a>TQHeader::mapToLogical ( int a ) const
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#mapToSection">mapToSection</a>() instead.
|
|
<p> Translates from actual index <em>a</em> (index at which the section is displayed) to
|
|
logical index of the section. Returns -1 if <em>a</em> is outside the legal range.
|
|
<p> <p>See also <a href="#mapToActual">mapToActual</a>().
|
|
|
|
<h3 class=fn>int <a name="mapToSection"></a>TQHeader::mapToSection ( int index ) const
|
|
</h3>
|
|
Returns the number of the section that corresponds to the specified <em>index</em>.
|
|
<p> <b>Warning:</b> If <a href="qtable.html">TQTable</a> is used to move header sections as a result of user
|
|
interaction, the mapping exposed by this function will not reflect the
|
|
order of the headers in the table; i.e., TQTable does not call <a href="#moveSection">moveSection</a>()
|
|
to move sections but handles move operations internally.
|
|
<p> <p>See also <a href="#mapToIndex">mapToIndex</a>().
|
|
|
|
<h3 class=fn>void <a name="moveCell"></a>TQHeader::moveCell ( int fromIdx, int toIdx )<tt> [virtual]</tt>
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#moveSection">moveSection</a>() instead.
|
|
<p> Moves the section that is currently displayed at index <em>fromIdx</em>
|
|
to index <em>toIdx</em>.
|
|
|
|
<h3 class=fn>void <a name="moveSection"></a>TQHeader::moveSection ( int section, int toIndex )
|
|
</h3>
|
|
Moves section <em>section</em> to index position <em>toIndex</em>.
|
|
|
|
<h3 class=fn>void <a name="moved"></a>TQHeader::moved ( int fromIndex, int toIndex )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#indexChange">indexChange</a>() instead.
|
|
<p> This signal is emitted when the user has moved the section which
|
|
is displayed at the index <em>fromIndex</em> to the index <em>toIndex</em>.
|
|
|
|
<h3 class=fn>int <a name="offset"></a>TQHeader::offset () const
|
|
</h3><p>Returns the header's left-most (or top-most) visible pixel.
|
|
See the <a href="qheader.html#offset-prop">"offset"</a> property for details.
|
|
<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>TQHeader::orientation () const
|
|
</h3><p>Returns the header's orientation.
|
|
See the <a href="qheader.html#orientation-prop">"orientation"</a> property for details.
|
|
<h3 class=fn>void <a name="paintSection"></a>TQHeader::paintSection ( <a href="qpainter.html">TQPainter</a> * p, int index, const <a href="qrect.html">TQRect</a> & fr )<tt> [virtual protected]</tt>
|
|
</h3>
|
|
Paints the section at position <em>index</em>, inside rectangle <em>fr</em>
|
|
(which uses widget coordinates) using painter <em>p</em>.
|
|
<p> Calls <a href="#paintSectionLabel">paintSectionLabel</a>().
|
|
|
|
<h3 class=fn>void <a name="paintSectionLabel"></a>TQHeader::paintSectionLabel ( <a href="qpainter.html">TQPainter</a> * p, int index, const <a href="qrect.html">TQRect</a> & fr )<tt> [virtual protected]</tt>
|
|
</h3>
|
|
Paints the label of the section at position <em>index</em>, inside
|
|
rectangle <em>fr</em> (which uses widget coordinates) using painter <em>p</em>.
|
|
<p> Called by <a href="#paintSection">paintSection</a>()
|
|
|
|
<h3 class=fn>void <a name="pressed"></a>TQHeader::pressed ( int section )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<p> This signal is emitted when the user presses section <em>section</em>
|
|
down.
|
|
<p> <p>See also <a href="#released">released</a>().
|
|
|
|
<h3 class=fn>void <a name="released"></a>TQHeader::released ( int section )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<p> This signal is emitted when section <em>section</em> is released.
|
|
<p> <p>See also <a href="#pressed">pressed</a>().
|
|
|
|
<h3 class=fn>void <a name="removeLabel"></a>TQHeader::removeLabel ( int section )
|
|
</h3>
|
|
Removes section <em>section</em>. If the section does not exist, nothing
|
|
happens.
|
|
|
|
<h3 class=fn>void <a name="resizeSection"></a>TQHeader::resizeSection ( int section, int s )
|
|
</h3>
|
|
Resizes section <em>section</em> to <em>s</em> pixels wide (or high).
|
|
|
|
<h3 class=fn><a href="qrect.html">TQRect</a> <a name="sRect"></a>TQHeader::sRect ( int index )<tt> [protected]</tt>
|
|
</h3>
|
|
Returns the rectangle covered by the section at index <em>index</em>.
|
|
|
|
<h3 class=fn>int <a name="sectionAt"></a>TQHeader::sectionAt ( int pos ) const
|
|
</h3>
|
|
Returns the index of the section which contains the position <em>pos</em> given in pixels from the left (or top).
|
|
<p> <p>See also <a href="#offset-prop">offset</a>.
|
|
|
|
<p>Example: <a href="helpsystem-example.html#x2677">helpsystem/tooltip.cpp</a>.
|
|
<h3 class=fn>void <a name="sectionClicked"></a>TQHeader::sectionClicked ( int index )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#clicked">clicked</a>() instead.
|
|
<p> This signal is emitted when a part of the header is clicked. <em>index</em> is the index at which the section is displayed.
|
|
<p> In a list view this signal would typically be connected to a slot
|
|
that sorts the specified column (or row).
|
|
|
|
<h3 class=fn>void <a name="sectionHandleDoubleClicked"></a>TQHeader::sectionHandleDoubleClicked ( int section )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<p> This signal is emitted when the user doubleclicks on the edge
|
|
(handle) of section <em>section</em>.
|
|
|
|
<h3 class=fn>int <a name="sectionPos"></a>TQHeader::sectionPos ( int section ) const
|
|
</h3>
|
|
Returns the position (in pixels) at which the <em>section</em> starts.
|
|
<p> <p>See also <a href="#offset-prop">offset</a>.
|
|
|
|
<h3 class=fn><a href="qrect.html">TQRect</a> <a name="sectionRect"></a>TQHeader::sectionRect ( int section ) const
|
|
</h3>
|
|
Returns the rectangle covered by section <em>section</em>.
|
|
|
|
<p>Example: <a href="helpsystem-example.html#x2678">helpsystem/tooltip.cpp</a>.
|
|
<h3 class=fn>int <a name="sectionSize"></a>TQHeader::sectionSize ( int section ) const
|
|
</h3>
|
|
Returns the width (or height) of the <em>section</em> in pixels.
|
|
|
|
<h3 class=fn>void <a name="setCellSize"></a>TQHeader::setCellSize ( int section, int s )<tt> [virtual]</tt>
|
|
</h3>
|
|
<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use <a href="#resizeSection">resizeSection</a>() instead.
|
|
<p> Sets the size of the section <em>section</em> to <em>s</em> pixels.
|
|
<p> <b>Warning:</b> does not repaint or send out signals
|
|
|
|
<h3 class=fn>void <a name="setClickEnabled"></a>TQHeader::setClickEnabled ( bool enable, int section = -1 )<tt> [virtual]</tt>
|
|
</h3>
|
|
If <em>enable</em> is TRUE, any clicks on section <em>section</em> will result
|
|
in <a href="#clicked">clicked</a>() signals being emitted; otherwise the section will
|
|
ignore clicks.
|
|
<p> If <em>section</em> is -1 (the default) then the <em>enable</em> value is set
|
|
for all existing sections and will be applied to any new sections
|
|
that are added.
|
|
<p> <p>See also <a href="#moving-prop">moving</a> and <a href="#setResizeEnabled">setResizeEnabled</a>().
|
|
|
|
<h3 class=fn>void <a name="setLabel"></a>TQHeader::setLabel ( int section, const <a href="qstring.html">TQString</a> & s, int size = -1 )<tt> [virtual]</tt>
|
|
</h3>
|
|
Sets the text of section <em>section</em> to <em>s</em>. The section's width
|
|
is set to <em>size</em> if <em>size</em> >= 0; otherwise it is left
|
|
unchanged. Any icon set that has been set for this section remains
|
|
unchanged.
|
|
<p> If the section does not exist, nothing happens.
|
|
|
|
<p>Examples: <a href="tutorial2-08.html#x2605">chart/setdataform.cpp</a> and <a href="small-table-example-example.html#x2798">table/small-table-demo/main.cpp</a>.
|
|
<h3 class=fn>void <a name="setLabel-2"></a>TQHeader::setLabel ( int section, const <a href="qiconset.html">TQIconSet</a> & iconset, const <a href="qstring.html">TQString</a> & s, int size = -1 )<tt> [virtual]</tt>
|
|
</h3>
|
|
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> Sets the icon for section <em>section</em> to <em>iconset</em> and the text to
|
|
<em>s</em>. The section's width is set to <em>size</em> if <em>size</em> >= 0;
|
|
otherwise it is left unchanged.
|
|
<p> If the section does not exist, nothing happens.
|
|
|
|
<h3 class=fn>void <a name="setMovingEnabled"></a>TQHeader::setMovingEnabled ( bool )<tt> [virtual]</tt>
|
|
</h3><p>Sets whether the header sections can be moved.
|
|
See the <a href="qheader.html#moving-prop">"moving"</a> property for details.
|
|
<h3 class=fn>void <a name="setOffset"></a>TQHeader::setOffset ( int pos )<tt> [virtual slot]</tt>
|
|
</h3><p>Sets the header's left-most (or top-most) visible pixel to <em>pos</em>.
|
|
See the <a href="qheader.html#offset-prop">"offset"</a> property for details.
|
|
<h3 class=fn>void <a name="setOrientation"></a>TQHeader::setOrientation ( <a href="qt.html#Orientation-enum">Orientation</a> )<tt> [virtual]</tt>
|
|
</h3><p>Sets the header's orientation.
|
|
See the <a href="qheader.html#orientation-prop">"orientation"</a> property for details.
|
|
<h3 class=fn>void <a name="setResizeEnabled"></a>TQHeader::setResizeEnabled ( bool enable, int section = -1 )<tt> [virtual]</tt>
|
|
</h3>
|
|
If <em>enable</em> is TRUE the user may resize section <em>section</em>;
|
|
otherwise the section may not be manually resized.
|
|
<p> If <em>section</em> is negative (the default) then the <em>enable</em> value
|
|
is set for all existing sections and will be applied to any new
|
|
sections that are added.
|
|
Example:
|
|
<pre>
|
|
// Allow resizing of all current and future sections
|
|
header->setResizeEnabled(TRUE);
|
|
// Disable resizing of section 3, (the fourth section added)
|
|
header->setResizeEnabled(FALSE, 3);
|
|
</pre>
|
|
|
|
<p> If the user resizes a section, a <a href="#sizeChange">sizeChange</a>() signal is emitted.
|
|
<p> <p>See also <a href="#moving-prop">moving</a>, <a href="#setClickEnabled">setClickEnabled</a>(), and <a href="#tracking-prop">tracking</a>.
|
|
|
|
<h3 class=fn>void <a name="setSortIndicator"></a>TQHeader::setSortIndicator ( int section, <a href="qt.html#SortOrder-enum">SortOrder</a> order )
|
|
</h3>
|
|
|
|
<p> Sets a sort indicator onto the specified <em>section</em>. The indicator's
|
|
<em>order</em> is either Ascending or Descending.
|
|
<p> Only one section can show a sort indicator at any one time. If you
|
|
don't want any section to show a sort indicator pass a <em>section</em>
|
|
number of -1.
|
|
<p> <p>See also <a href="#sortIndicatorSection">sortIndicatorSection</a>() and <a href="#sortIndicatorOrder">sortIndicatorOrder</a>().
|
|
|
|
<h3 class=fn>void <a name="setSortIndicator-2"></a>TQHeader::setSortIndicator ( int section, bool ascending = TRUE )
|
|
</h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
|
<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
|
<p> Use the other overload instead.
|
|
|
|
<h3 class=fn>void <a name="setStretchEnabled"></a>TQHeader::setStretchEnabled ( bool b, int section )<tt> [virtual]</tt>
|
|
</h3>
|
|
If <em>b</em> is TRUE, section <em>section</em> will be resized when the
|
|
header is resized, so that the sections take up the full width (or
|
|
height for vertical headers) of the header; otherwise section <em>section</em> will be set to be unstretchable and will not resize when
|
|
the header is resized.
|
|
<p> If <em>section</em> is -1, and if <em>b</em> is TRUE, then all sections will
|
|
be resized equally when the header is resized so that they take up
|
|
the full width (or height for vertical headers) of the header;
|
|
otherwise all the sections will be set to be unstretchable and
|
|
will not resize when the header is resized.
|
|
<p> <p>See also <a href="#adjustHeaderSize">adjustHeaderSize</a>().
|
|
|
|
<h3 class=fn>void <a name="setStretchEnabled-2"></a>TQHeader::setStretchEnabled ( bool b )
|
|
</h3><p>Sets whether the header sections always take up the full width (or height) of the header to <em>b</em>.
|
|
See the <a href="qheader.html#stretching-prop">"stretching"</a> property for details.
|
|
<h3 class=fn>void <a name="setTracking"></a>TQHeader::setTracking ( bool enable )<tt> [virtual]</tt>
|
|
</h3><p>Sets whether the <a href="#sizeChange">sizeChange</a>() signal is emitted continuously to <em>enable</em>.
|
|
See the <a href="qheader.html#tracking-prop">"tracking"</a> property for details.
|
|
<h3 class=fn>void <a name="sizeChange"></a>TQHeader::sizeChange ( int section, int oldSize, int newSize )<tt> [signal]</tt>
|
|
</h3>
|
|
|
|
<p> This signal is emitted when the user has changed the size of a <em>section</em> from <em>oldSize</em> to <em>newSize</em>. This signal is typically
|
|
connected to a slot that repaints the table or list that contains
|
|
the header.
|
|
|
|
<h3 class=fn><a href="qt.html#SortOrder-enum">SortOrder</a> <a name="sortIndicatorOrder"></a>TQHeader::sortIndicatorOrder () const
|
|
</h3>
|
|
Returns the implied sort order of the TQHeaders sort indicator.
|
|
<p> <p>See also <a href="#setSortIndicator">setSortIndicator</a>() and <a href="#sortIndicatorSection">sortIndicatorSection</a>().
|
|
|
|
<h3 class=fn>int <a name="sortIndicatorSection"></a>TQHeader::sortIndicatorSection () const
|
|
</h3>
|
|
Returns the section showing the sort indicator or -1 if there is no sort indicator.
|
|
<p> <p>See also <a href="#setSortIndicator">setSortIndicator</a>() and <a href="#sortIndicatorOrder">sortIndicatorOrder</a>().
|
|
|
|
<h3 class=fn>bool <a name="tracking"></a>TQHeader::tracking () const
|
|
</h3><p>Returns TRUE if the <a href="#sizeChange">sizeChange</a>() signal is emitted continuously; otherwise returns FALSE.
|
|
See the <a href="qheader.html#tracking-prop">"tracking"</a> property for details.
|
|
<hr><h2>Property Documentation</h2>
|
|
<h3 class=fn>int <a name="count-prop"></a>count</h3>
|
|
<p>This property holds the number of sections in the header.
|
|
<p>
|
|
<p>Get this property's value with <a href="#count">count</a>().
|
|
<h3 class=fn>bool <a name="moving-prop"></a>moving</h3>
|
|
<p>This property holds whether the header sections can be moved.
|
|
<p>If this property is TRUE (the default) the user can move sections.
|
|
If the user moves a section the <a href="#indexChange">indexChange</a>() signal is emitted.
|
|
<p> <p>See also <a href="#setClickEnabled">setClickEnabled</a>() and <a href="#setResizeEnabled">setResizeEnabled</a>().
|
|
|
|
<p>Set this property's value with <a href="#setMovingEnabled">setMovingEnabled</a>() and get this property's value with <a href="#isMovingEnabled">isMovingEnabled</a>().
|
|
<h3 class=fn>int <a name="offset-prop"></a>offset</h3>
|
|
<p>This property holds the header's left-most (or top-most) visible pixel.
|
|
<p>Setting this property will scroll the header so that <em>offset</em>
|
|
becomes the left-most (or top-most for vertical headers) visible
|
|
pixel.
|
|
|
|
<p>Set this property's value with <a href="#setOffset">setOffset</a>() and get this property's value with <a href="#offset">offset</a>().
|
|
<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation-prop"></a>orientation</h3>
|
|
<p>This property holds the header's orientation.
|
|
<p>The orientation is either <a href="qt.html#Orientation-enum">Vertical</a> or <a href="qt.html#Orientation-enum">Horizontal</a> (the
|
|
default).
|
|
<p> Call <a href="#setOrientation">setOrientation</a>() before adding labels if you don't provide a
|
|
size parameter otherwise the sizes will be incorrect.
|
|
|
|
<p>Set this property's value with <a href="#setOrientation">setOrientation</a>() and get this property's value with <a href="#orientation">orientation</a>().
|
|
<h3 class=fn>bool <a name="stretching-prop"></a>stretching</h3>
|
|
<p>This property holds whether the header sections always take up the full width (or height) of the header.
|
|
<p>
|
|
<p>Set this property's value with <a href="#setStretchEnabled">setStretchEnabled</a>() and get this property's value with <a href="#isStretchEnabled">isStretchEnabled</a>().
|
|
<h3 class=fn>bool <a name="tracking-prop"></a>tracking</h3>
|
|
<p>This property holds whether the <a href="#sizeChange">sizeChange</a>() signal is emitted continuously.
|
|
<p>If tracking is on, the sizeChange() signal is emitted continuously
|
|
while the mouse is moved (i.e. when the header is resized),
|
|
otherwise it is only emitted when the mouse button is released at
|
|
the end of resizing.
|
|
<p> Tracking defaults to FALSE.
|
|
|
|
<p>Set this property's value with <a href="#setTracking">setTracking</a>() and get this property's value with <a href="#tracking">tracking</a>().
|
|
<!-- eof -->
|
|
<hr><p>
|
|
This file is part of the <a href="index.html">TQt toolkit</a>.
|
|
Copyright © 1995-2007
|
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
|
<table width=100% cellspacing=0 border=0><tr>
|
|
<td>Copyright © 2007
|
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
|
<td align=right><div align=right>TQt 3.3.8</div>
|
|
</table></div></address></body>
|
|
</html>
|