From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- doc/html/qiconset.html | 328 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100644 doc/html/qiconset.html (limited to 'doc/html/qiconset.html') diff --git a/doc/html/qiconset.html b/doc/html/qiconset.html new file mode 100644 index 000000000..2389f0624 --- /dev/null +++ b/doc/html/qiconset.html @@ -0,0 +1,328 @@ + + + + + +TQIconSet Class + + + + + + + +
+ +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

TQIconSet Class Reference

+ +

The TQIconSet class provides a set of icons with different +styles and sizes. +More... +

#include <qiconset.h> +

List of all member functions. +

Public Members

+ +

Static Public Members

+ +

Detailed Description

+ +

The TQIconSet class provides a set of icons with different +styles and sizes. +

+ + + +

A TQIconSet can generate smaller, larger, active, and disabled pixmaps +from the set of icons it is given. Such pixmaps are used by +TQToolButton, TQHeader, TQPopupMenu, etc. to show an icon representing a +particular action. +

The simplest use of TQIconSet is to create one from a TQPixmap and then +use it, allowing TQt to work out all the retquired icon styles and +sizes. For example: +

+    TQToolButton *but = new TQToolButton( TQIconSet( TQPixmap("open.xpm") ), ... );
+  
+ +

Using whichever pixmaps you specify as a base, TQIconSet provides a +set of six icons, each with a Size and a Mode: Small Normal, +Small Disabled, Small Active, Large Normal, Large Disabled, and +Large Active. +

An additional set of six icons can be provided for widgets that have +an "On" or "Off" state, like checkable menu items or toggleable +toolbuttons. If you provide pixmaps for the "On" state, but not for +the "Off" state, the TQIconSet will provide the "Off" pixmaps. You may +specify icons for both states in you wish. +

You can set any of the icons using setPixmap(). +

When you retrieve a pixmap using pixmap(Size, Mode, State), +TQIconSet will return the icon that has been set or previously +generated for that size, mode and state combination. If none is +available, TQIconSet will ask the icon factory. If the icon factory +cannot provide any (the default), TQIconSet generates a pixmap based +on the pixmaps it has been given and returns it. +

The Disabled appearance is computed using an algorithm that +produces results very similar to those used in Microsoft Windows +95. The Active appearance is identical to the Normal +appearance unless you use setPixmap() to set it to something +special. +

When scaling icons, TQIconSet uses smooth scaling, which can partially blend the color component +of pixmaps. If the results look poor, the best solution +is to supply pixmaps in both large and small sizes. +

You can use the static function setIconSize() to set the preferred +size of the generated large/small icons. The default small size is +22 x 22, while the default large size is 32 x 32. These sizes only +affect generated icons. +

The isGenerated() function returns TRUE if an icon was generated by +TQIconSet or by a factory; clearGenerated() clears all cached +pixmaps. +

Making Classes that Use TQIconSet +

+

If you write your own widgets that have an option to set a small +pixmap, consider allowing a TQIconSet to be set for that pixmap. The +TQt class TQToolButton is an example of such a widget. +

Provide a method to set a TQIconSet, and when you draw the icon, choose +whichever icon is appropriate for the current state of your widget. +For example: +

+    void MyWidget::drawIcon( TQPainter* p, TQPoint pos )
+    {
+        p->drawPixmap( pos, icons->pixmap(
+                                TQIconSet::Small,
+                                isEnabled() ? TQIconSet::Normal :
+                                              TQIconSet::Disabled,
+                                isEnabled() ? TQIconSet::On :
+                                              TQIconSet::Off));
+    }
+  
+ +

You might also make use of the Active mode, perhaps making your +widget Active when the mouse is over the widget (see TQWidget::enterEvent()), while the mouse is pressed pending the +release that will activate the function, or when it is the currently +selected item. If the widget can be toggled, the "On" mode might be +used to draw a different icon. +

TQIconSet
+

See also TQIconFactory, TQPixmap, TQMainWindow::usesBigPixmaps, GUI Design Handbook: Iconic Label, Graphics Classes, Image Processing Classes, and Implicitly and Explicitly Shared Classes. + +


Member Type Documentation

+

TQIconSet::Mode

+ +

This enum type describes the mode for which a pixmap is intended to be +used. +The currently defined modes are: +

+

TQIconSet::Size

+ +

This enum type describes the size at which a pixmap is intended to be +used. +The currently defined sizes are: +

If a Small pixmap is not set by TQIconSet::setPixmap(), the Large +pixmap will be automatically scaled down to the size of a small pixmap +to generate the Small pixmap when retquired. Similarly, a Small pixmap +will be automatically scaled up to generate a Large pixmap. The +preferred sizes for large/small generated icons can be set using +setIconSize(). +

See also setIconSize(), iconSize(), setPixmap(), pixmap(), and TQMainWindow::usesBigPixmaps. + +

TQIconSet::State

+ +

This enum describes the state for which a pixmap is intended to be +used. The state can be: +

See also setPixmap() and pixmap(). + +


Member Function Documentation

+

TQIconSet::TQIconSet () +

+Constructs a null icon set. +

See also setPixmap() and reset(). + +

TQIconSet::TQIconSet ( const TQPixmap & pixmap, Size size = Automatic ) +

+Constructs an icon set for which the Normal pixmap is pixmap, +which is assumed to be of size size. +

The default for size is Automatic, which means that TQIconSet +will determine whether the pixmap is Small or Large from its pixel +size. Pixmaps less than the width of a small generated icon are +considered to be Small. You can use setIconSize() to set the +preferred size of a generated icon. +

See also setIconSize() and reset(). + +

TQIconSet::TQIconSet ( const TQPixmap & smallPix, const TQPixmap & largePix ) +

Creates an iconset which uses the pixmap smallPix for for +displaying a small icon, and the pixmap largePix for displaying a +large icon. + +

TQIconSet::TQIconSet ( const TQIconSet & other ) +

+Constructs a copy of other. This is very fast. + +

TQIconSet::~TQIconSet () [virtual] +

+Destroys the icon set and frees any allocated resources. + +

void TQIconSet::clearGenerated () +

+Clears all cached pixmaps, including those obtained from an +eventual TQIconFactory. + +

void TQIconSet::detach () +

+Detaches this icon set from others with which it may share data. +

You will never need to call this function; other TQIconSet functions +call it as necessary. + +

const TQSize & TQIconSet::iconSize ( Size which ) [static] +

+If which is Small, returns the preferred size of a small +generated icon; if which is Large, returns the preferred size +of a large generated icon. +

See also setIconSize(). + +

void TQIconSet::installIconFactory ( TQIconFactory * factory ) +

+Installs factory as the icon factory for this iconset. The +icon factory is used to generates pixmaps not set by the user. +

If no icon factory is installed, TQIconFactory::defaultFactory() +is used. + +

bool TQIconSet::isGenerated ( Size size, Mode mode, State state = Off ) const +

+Returns TRUE if the pixmap with size size, mode mode and +state state is generated from other pixmaps; otherwise returns +FALSE. +

A pixmap obtained from a TQIconFactory is considered non-generated. + +

bool TQIconSet::isNull () const +

+Returns TRUE if the icon set is empty; otherwise returns FALSE. + +

TQIconSet & TQIconSet::operator= ( const TQIconSet & other ) +

+Assigns other to this icon set and returns a reference to this +icon set. +

See also detach(). + +

TQPixmap TQIconSet::pixmap ( Size size, Mode mode, State state = Off ) const +

+Returns a pixmap with size size, mode mode and state state, generating one if necessary. Generated pixmaps are cached. + +

TQPixmap TQIconSet::pixmap ( Size size, bool enabled, State state = Off ) const +

This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

This is the same as pixmap(size, enabled, state). + +

TQPixmap TQIconSet::pixmap () const +

+This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

Returns the pixmap originally provided to the constructor or to +reset(). This is the Normal pixmap of unspecified Size. +

See also reset(). + +

void TQIconSet::reset ( const TQPixmap & pixmap, Size size ) +

+Sets this icon set to use pixmap pixmap for the Normal pixmap, +assuming it to be of size size. +

This is equivalent to assigning TQIconSet(pixmap, size) to this +icon set. +

This function does nothing if pixmap is a null pixmap. + +

void TQIconSet::setIconSize ( Size which, const TQSize & size ) [static] +

+Set the preferred size for all small or large icons that are +generated after this call. If which is Small, sets the preferred +size of small generated icons to size. Similarly, if which is +Large, sets the preferred size of large generated icons to size. +

Note that cached icons will not be regenerated, so it is recommended +that you set the preferred icon sizes before generating any icon sets. +Also note that the preferred icon sizes will be ignored for icon sets +that have been created using both small and large pixmaps. +

See also iconSize(). + +

void TQIconSet::setPixmap ( const TQPixmap & pixmap, Size size, Mode mode = Normal, State state = Off ) [virtual] +

+Sets this icon set to provide pixmap pixmap for size size, mode mode and state state. The icon set may also use pixmap for +generating other pixmaps if they are not explicitly set. +

The size can be one of Automatic, Large or Small. If Automatic is +used, TQIconSet will determine if the pixmap is Small or Large from its +pixel size. +

Pixmaps less than the width of a small generated icon are +considered to be Small. You can use setIconSize() to set the preferred +size of a generated icon. +

This function does nothing if pixmap is a null pixmap. +

See also reset(). + +

void TQIconSet::setPixmap ( const TQString & fileName, Size size, Mode mode = Normal, State state = Off ) [virtual] +

+This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

The pixmap is loaded from fileName when it becomes necessary. + + +


+This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


+ +
Copyright © 2007 +TrolltechTrademarks +
TQt 3.3.8
+
+ -- cgit v1.2.1