⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qheader.html

📁 QT参考文档
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p>当用户按下节<em>section</em>时,本信号被发送。<p> <p>也参见<a href="#released">released</a>()。<h3 class=fn>void <a name="released"></a>QHeader::released ( int&nbsp;section )<tt> [信号]</tt></h3><p>当用户释放节<em>section</em>时,本信号被发送。<p> <p>也参见<a href="#pressed">pressed</a>()。<h3 class=fn>void <a name="removeLabel"></a>QHeader::removeLabel ( int&nbsp;section )</h3>删去节<em>section</em>。如果该节不存在,什么也不做。<h3 class=fn>void <a name="resizeSection"></a>QHeader::resizeSection ( int&nbsp;section, int&nbsp;s )</h3>调整节<em>section</em>的大小为<em>s</em>象素宽(或者高)。<h3 class=fn><a href="qrect.html">QRect</a> <a name="sRect"></a>QHeader::sRect ( int&nbsp;index )<tt> [protected]</tt></h3>返回被索引为<em>index</em>的节所覆盖的矩形。<h3 class=fn>int <a name="sectionAt"></a>QHeader::sectionAt ( int&nbsp;pos ) const</h3>返回包括以象素给出的位置<em>pos</em>的节索引。<p> <p>也参见<a href="#offset-prop">offset</a>。<h3 class=fn>void <a name="sectionClicked"></a>QHeader::sectionClicked ( int&nbsp;index )<tt> [信号]</tt></h3><b>本函数已经废弃。</b>为支持旧代码运行而提供,强烈建议新代码中不要使用。<p>使用<a href="#clicked">clicked</a>()来代替本函数。<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 slotthat sorts the specified column (or row)。<h3 class=fn>int <a name="sectionPos"></a>QHeader::sectionPos ( int&nbsp;section ) const</h3>返回节<em>section</em>开始的位置(以象素形式)。<p> <p>也参见<a href="#offset-prop">offset</a>。<h3 class=fn><a href="qrect.html">QRect</a> <a name="sectionRect"></a>QHeader::sectionRect ( int&nbsp;section ) const</h3>返回被节<em>section</em>所覆盖的矩形。<h3 class=fn>int <a name="sectionSize"></a>QHeader::sectionSize ( int&nbsp;section ) const</h3>以象素形式返回节<em>section</em>的宽度(或者高度)。<h3 class=fn>void <a name="setCellSize"></a>QHeader::setCellSize ( int&nbsp;section, int&nbsp;s )<tt> [虚]</tt></h3><b>本函数已经废弃。</b>为支持旧代码运行而提供,强烈建议新代码中不要使用。<p>使用<a href="#resizeSection">resizeSection</a>()来代替本函数。<p> Sets the size of the section <em>section</em> to <em>s</em> pixels.<p> <b>警告:</b> does not repaint or send out signals。<h3 class=fn>void <a name="setClickEnabled"></a>QHeader::setClickEnabled ( bool&nbsp;enable, int&nbsp;section = -1 )<tt> [虚]</tt></h3>如果<em>enable</em>为TRUE,点击节<em>section</em>就会导致<a href="#clicked">clicked</a>()信号被发送;否则节将忽略点击。<p>如果<em>section</em>为-1(缺省),那么<em>enable</em>值对所有存在的节都设置,而且也应用到增加的新节上。<p> <p>也参见<a href="#moving-prop">moving</a>和<a href="#setResizeEnabled">setResizeEnabled</a>()。<h3 class=fn>void <a name="setLabel"></a>QHeader::setLabel ( int&nbsp;section, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;s, int&nbsp;size = -1 )<tt> [虚]</tt></h3>设置节<em>section</em>的文本为<em>s</em>。如果<em>size</em> &gt;= 0,节的宽度设置为<em>size</em>;否则不变。该节已经设置的图标保持不变。<p>如果该节不存在,什么也不做。<p>例子:<a href="tutorial2-08.html#x2510">chart/setdataform.cpp</a>和<a href="small-table-example-example.html#x2645">table/small-table-demo/main.cpp</a>。<h3 class=fn>void <a name="setLabel-2"></a>QHeader::setLabel ( int&nbsp;section, const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;iconset, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;s, int&nbsp;size = -1 )<tt> [虚]</tt></h3>这是重载的成员函数,为便利而提供。其行为本质上类似上一个函数。<p>把节<em>section</em>的图标设置为<em>iconset</em>,文本设置为<em>s</em>。如果<em>size</em> &gt;= 0,节的宽度设置为<em>size</em>;否则不变。<p>如果该节不存在,什么也不做。<h3 class=fn>void <a name="setMovingEnabled"></a>QHeader::setMovingEnabled ( bool )<tt> [虚]</tt></h3><p>设置标题的节是否可以移动。详见<a href="qheader.html#moving-prop">"moving"</a>属性。<h3 class=fn>void <a name="setOffset"></a>QHeader::setOffset ( int&nbsp;pos )<tt> [虚 槽]</tt></h3><p>设置标题的最左(或者最上)的可见象素为<em>pos</em>。详见<a href="qheader.html#offset-prop">"offset"</a>属性。<h3 class=fn>void <a name="setOrientation"></a>QHeader::setOrientation ( <a href="qt.html#Orientation-enum">Orientation</a> )<tt> [虚]</tt></h3><p>设置标题的物理朝向。详见<a href="qheader.html#orientation-prop">"orientation"</a>属性。<h3 class=fn>void <a name="setResizeEnabled"></a>QHeader::setResizeEnabled ( bool&nbsp;enable, int&nbsp;section = -1 )<tt> [虚]</tt></h3>如果<em>enable</em>为TRUE,用户可以调整节<em>section</em>的大小;否则该节不能被手动调整大小。<p>如果<em>section</em>为负(缺省),那么<em>enable</em>值对所有存在的节都设置,而且也应用到增加的新节上。例子:<pre>    // Allow resizing of all current and future sections    header-&gt;setResizeEnabled(TRUE);    // Disable resizing of section 3, (the fourth section added)    header-&gt;setResizeEnabled(FALSE, 3);    </pre> <p>如果用户调整了一个节的大小,<a href="#sizeChange">sizeChange</a>()信号被发送。<p> <p>也参见<a href="#moving-prop">moving</a>、<a href="#setClickEnabled">setClickEnabled</a>()和<a href="#tracking-prop">tracking</a>。<h3 class=fn>void <a name="setSortIndicator"></a>QHeader::setSortIndicator ( int&nbsp;section, bool&nbsp;increasing = TRUE )</h3>因为QHeader经常与表格或者列表部件一起使用,它可以显示排序的次序。这可以通过在节的右边显示一个箭头来实现。<p>如果<em>increasing</em>为TRUE(缺省),箭头指向下;否则向上。<p>同一时间只能有一个节显示排序指示。如果你不想让任何节显示排序指示器,传入参数<em>section</em>为-1。<p><h3 class=fn>void <a name="setStretchEnabled"></a>QHeader::setStretchEnabled ( bool&nbsp;b, int&nbsp;section )<tt> [虚]</tt></h3>如果<em>b</em>为TRUE,节<em>section</em>的大小将会随标题的大小调整而调整,以使节占据标题的全部宽度(对于垂直标题则是高度);否则,节<em>section</em>被设置为不可伸缩,也不会随标题的调整大小而调整大小。<p>在<em>section</em>为-1时,如果<em>b</em>为TRUE,所有节的大小相等地随标题的大小调整而调整,以使节占据标题的全部宽度(对于垂直标题则是高度);否则,所有节都被设置为不可伸缩,也不会随标题的调整大小而调整大小。<p> <p>也参见<a href="#adjustHeaderSize">adjustHeaderSize</a>()。<h3 class=fn>void <a name="setStretchEnabled-2"></a>QHeader::setStretchEnabled ( bool&nbsp;b )</h3><p>设置标题的节是否总是占据标题的全部宽度(或者高度)为<em>b</em>。详见<a href="qheader.html#stretching-prop">"stretching"</a>属性。<h3 class=fn>void <a name="setTracking"></a>QHeader::setTracking ( bool&nbsp;enable )<tt> [虚]</tt></h3><p>设置<a href="#sizeChange">sizeChange</a>()信号是否持续被发送为<em>enable</em>。详见<a href="qheader.html#tracking-prop">"tracking"</a>属性。<h3 class=fn>void <a name="sizeChange"></a>QHeader::sizeChange ( int&nbsp;section, int&nbsp;oldSize, int&nbsp;newSize )<tt> [信号]</tt></h3><p>当用户把节<em>section</em>的大小从<em>oldSize</em>改为<em>newSize</em>时,本信号被发送。典型地,本信号连接到一个槽上,这个槽重绘包括该标题的表格或者列表。<h3 class=fn>bool <a name="tracking"></a>QHeader::tracking () const</h3><p>如果<a href="#sizeChange">sizeChange</a>()信号是持续被发送的,返回TRUE;否则返回FALSE。详见<a href="qheader.html#tracking-prop">"tracking"</a>属性。<hr><h2>属性文档</h2><h3 class=fn>int <a name="count-prop"></a>count</h3> <p>本属性决定标题中的节的数目。<p><p>用<a href="#count">count</a>()来得到本属性值。<h3 class=fn>bool <a name="moving-prop"></a>moving</h3> <p>得到本属性值标题的节是否可以被移动。<p>如果本属性为TRUE,用户可以移动节。如果用户移动某个节,<a href="#indexChange">indexChange</a>()信号被发送。<p> <p>也参见<a href="#setClickEnabled">setClickEnabled</a>()和<a href="#setResizeEnabled">setResizeEnabled</a>()。<p>用<a href="#setMovingEnabled">setMovingEnabled</a>()设置本属性值,用<a href="#isMovingEnabled">isMovingEnabled</a>()得到本属性值。<h3 class=fn>int <a name="offset-prop"></a>offset</h3> <p>本属性决定标题的最左(或者最上)的可见象素。<p>设置本属性将滚动标题以使得<em>offset</em>成为最左(或者最上,对于垂直标题)的可见象素。<p>用<a href="#setOffset">setOffset</a>()设置本属性值,用<a href="#offset">offset</a>()得到本属性值。<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation-prop"></a>orientation</h3> <p>本属性决定标题的物理朝向。<p>朝向要么是QHeader::Vertical,要么就是QHeader::Horizontal(缺省)。<p>如果你没有提供大小参数,就要在添加标签之前调用<a href="#setOrientation">setOrientation</a>(),否则大小会不正确。<p>用<a href="#setOrientation">setOrientation</a>()设置本属性值,用<a href="#orientation">orientation</a>()得到本属性值。<h3 class=fn>bool <a name="stretching-prop"></a>stretching</h3> <p>本属性决定标题的节是否总是占据标题的全部宽度(或者高度)。<p><p>用<a href="#setStretchEnabled">setStretchEnabled</a>()设置本属性值,用<a href="#isStretchEnabled">isStretchEnabled</a>()得到本属性值。<h3 class=fn>bool <a name="tracking-prop"></a>tracking</h3> <p>本属性决定<a href="#sizeChange">sizeChange</a>()信号是否持续地被发送。<p>如果tracking为打开,当鼠标移动(也就是标题被调整大小)时,sizeChange()信号持续地被发送;否则,只有在大小调整结束鼠标按键释放时,才发送信号。<p>Tracking缺省为FALSE。<p>用<a href="#setTracking">setTracking</a>()设置本属性值,用<a href="#tracking">tracking</a>()得到本属性值。<!-- eof --><p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td><a href="zh_CN.html">译者:farfareast</a><td align=right><div align=right>Qt 3.0.5版</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -