📄 qiconset.html
字号:
<p> This enum type describes the size at which a pixmap is intended to beused.The currently defined sizes are:<ul><li><tt>QIconSet::Automatic</tt> - The size of the pixmap is determined from itspixel size. This is a useful default.<li><tt>QIconSet::Small</tt> - The pixmap is the smaller of two.<li><tt>QIconSet::Large</tt> - The pixmap is the larger of two.</ul><p> If a Small pixmap is not set by <a href="#setPixmap">QIconSet::setPixmap</a>(), the Largepixmap will be automatically scaled down to the size of a small pixmapto generate the Small pixmap when required. Similarly, a Small pixmapwill be automatically scaled up to generate a Large pixmap. Thepreferred sizes for large/small generated icons can be set using<a href="#setIconSize">setIconSize</a>().<p> <p>See also <a href="#setIconSize">setIconSize</a>(), <a href="#iconSize">iconSize</a>(), <a href="#setPixmap">setPixmap</a>(), <a href="#pixmap">pixmap</a>() and <a href="qmainwindow.html#usesBigPixmaps-prop">QMainWindow::usesBigPixmaps</a>.<h3 class=fn><a name="State-enum"></a>QIconSet::State</h3><p> This enum describes the state for which a pixmap is intended to beused. The <em>state</em> can be:<ul><li><tt>QIconSet::Off</tt> - Display the pixmap when the widget is in an "off" state<li><tt>QIconSet::On</tt> - Display the pixmap when the widget is in an "on" state</ul><p> <p>See also <a href="#setPixmap">setPixmap</a>() and <a href="#pixmap">pixmap</a>().<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QIconSet"></a>QIconSet::QIconSet ()</h3>Constructs a null icon set.Use <a href="#setPixmap">setPixmap</a>(), <a href="#reset">reset</a>(), or <a href="#operator-eq">operator=</a>() to set some pixmaps.<p> <p>See also <a href="#reset">reset</a>().<h3 class=fn><a name="QIconSet-2"></a>QIconSet::QIconSet ( const <a href="qpixmap.html">QPixmap</a> & pixmap, <a href="qiconset.html#Size-enum">Size</a> size = Automatic )</h3> Constructs an icon set for which the Normal pixmap is<em>pixmap</em>, which is assumed to be of size <em>size</em>.<p> The default for <em>size</em> is <a href="#Size-enum">Automatic</a>, which means thatQIconSet will determine whether the pixmap is Small or Largefrom its pixel size.Pixmaps less than the width of a small generated icon areconsidered to be Small. You can use <a href="#setIconSize">setIconSize</a>() to set the preferredsize of a generated icon.<p> <p>See also <a href="#setIconSize">setIconSize</a>() and <a href="#reset">reset</a>().<h3 class=fn><a name="QIconSet-3"></a>QIconSet::QIconSet ( const <a href="qpixmap.html">QPixmap</a> & smallPix, const <a href="qpixmap.html">QPixmap</a> & largePix )</h3> Creates an iconset which uses the pixmap <em>smallPix</em> for fordisplaying a small icon, and the pixmap <em>largePix</em> for displaying alarge icon.<h3 class=fn><a name="QIconSet-4"></a>QIconSet::QIconSet ( const <a href="qiconset.html">QIconSet</a> & other )</h3>Constructs a copy of <em>other</em>. This is very fast.<h3 class=fn><a name="~QIconSet"></a>QIconSet::~QIconSet ()<tt> [virtual]</tt></h3>Destroys the icon set and frees any allocated resources.<h3 class=fn>void <a name="clearGenerated"></a>QIconSet::clearGenerated ()</h3>Clears all generated pixmaps.<h3 class=fn>void <a name="detach"></a>QIconSet::detach ()</h3>Detaches this icon set from others with which it may share data.<p> You will never need to call this function; other QIconSet functionscall it as necessary.<h3 class=fn>const <a href="qsize.html">QSize</a> & <a name="iconSize"></a>QIconSet::iconSize ( <a href="qiconset.html#Size-enum">Size</a> s )<tt> [static]</tt></h3>If <em>s</em> is Small, returns the preferred size of a small generatedicon; if <em>s</em> is Large, returns the preferred size of a largegenerated icon.<p> <p>See also <a href="#setIconSize">setIconSize</a>().<h3 class=fn>bool <a name="isGenerated"></a>QIconSet::isGenerated ( <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode, <a href="qiconset.html#State-enum">State</a> state = Off ) const</h3>Returns TRUE if the pixmap with size <em>size</em>, mode <em>mode</em> and state<em>state</em> has been generated; otherwise returns FALSE.<h3 class=fn>bool <a name="isNull"></a>QIconSet::isNull () const</h3>Returns TRUE if the icon set is empty; otherwise returns FALSE.<h3 class=fn><a href="qiconset.html">QIconSet</a> & <a name="operator-eq"></a>QIconSet::operator= ( const <a href="qiconset.html">QIconSet</a> & other )</h3>Assigns <em>other</em> to this icon set and returns a reference to thisicon set.<p> This is very fast.<p> <p>See also <a href="#detach">detach</a>().<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap"></a>QIconSet::pixmap ( <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode, <a href="qiconset.html#State-enum">State</a> state = Off ) const</h3>Returns a pixmap with size <em>size</em>, mode <em>mode</em> and state <em>state</em>,generating one if necessary. Generated pixmaps are cached.<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-2"></a>QIconSet::pixmap ( <a href="qiconset.html#Size-enum">Size</a> size, bool enabled, <a href="qiconset.html#State-enum">State</a> state = Off ) const</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Returns a pixmap with size <em>size</em>, state <em>state</em> and a Mode which isNormal if <em>enabled</em> is TRUE, or Disabled if <em>enabled</em> is FALSE.<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-3"></a>QIconSet::pixmap () const</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Returns the pixmap originally provided to the constructor orto <a href="#reset">reset</a>(). This is the Normal pixmap of unspecified Size.<p> <p>See also <a href="#reset">reset</a>().<h3 class=fn>void <a name="reset"></a>QIconSet::reset ( const <a href="qpixmap.html">QPixmap</a> & pm, <a href="qiconset.html#Size-enum">Size</a> size )</h3>Sets this icon set to use pixmap <em>pm</em> for the Normal pixmap,assuming it to be of size <em>size</em>.<p> This is equivalent to assigning QIconSet(<em>pm</em>, <em>size</em>) to thisicon set.<p> This function does nothing if <em>pm</em> is a null pixmap.<h3 class=fn>void <a name="setIconSize"></a>QIconSet::setIconSize ( <a href="qiconset.html#Size-enum">Size</a> s, const <a href="qsize.html">QSize</a> & size )<tt> [static]</tt></h3>Set the preferred size for all small or large icons that are generatedafter this call. If <em>s</em> is Small, sets the preferred size of smallgenerated icons to <em>size</em>. Similarly, if <em>s</em> is Large, sets thepreferred size of large generated icons to <em>size</em>.<p> Note that cached icons will not be regenerated, so it is recommendedthat you set the preferred icon sizes before generating any icon sets.Also note that the preferred icon sizes will be ignored for icon setsthat have been created using both small and large pixmaps.<p> <p>See also <a href="#iconSize">iconSize</a>().<h3 class=fn>void <a name="setPixmap"></a>QIconSet::setPixmap ( const <a href="qpixmap.html">QPixmap</a> & pm, <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode = Normal, <a href="qiconset.html#State-enum">State</a> state = Off )<tt> [virtual]</tt></h3>Sets this icon set to provide pixmap <em>pm</em> for size <em>size</em>, mode <em>mode</em> and state <em>state</em>. The icon set may also use <em>pm</em> forgenerating other pixmaps if they are not explicitly set.<p> The <em>size</em> can be one of Automatic, Large or Small. If Automatic isused, QIconSet will determine if the pixmap is Small or Large from itspixel size.<p> Pixmaps less than the width of a small generated icon areconsidered to be Small. You can use <a href="#setIconSize">setIconSize</a>() to set the preferredsize of a generated icon.<p> This function does nothing if <em>pm</em> is a null pixmap.<p> <p>See also <a href="#reset">reset</a>().<h3 class=fn>void <a name="setPixmap-2"></a>QIconSet::setPixmap ( const <a href="qstring.html">QString</a> & fileName, <a href="qiconset.html#Size-enum">Size</a> size, <a href="qiconset.html#Mode-enum">Mode</a> mode = Normal, <a href="qiconset.html#State-enum">State</a> state = Off )<tt> [virtual]</tt></h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Sets this icon set to load the file called <em>fileName</em> as a pixmap anduse it for size <em>size</em>, mode <em>mode</em> and state <em>state</em>. The icon setmay also use this pixmap for generating other pixmaps if they are notexplicitly set.<p> The <em>size</em> can be one of Automatic, Large or Small. If Automatic isused, QIconSet will determine if the pixmap is Small or Large from itspixel size.Pixmaps less than the width of a small generated icon areconsidered to be Small. You can use <a href="#setIconSize">setIconSize</a>() to set the preferredsize of a generated icon.<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<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 © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -