Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QIconSelector Class Reference
[QtBaseModule]

The QIconSelector class provides an icon-based combo box implementation. More...

    #include <QIconSelector>

Inherits QToolButton.

Public Functions

Public Slots

Signals

Protected Functions

Protected Slots

Additional Inherited Members


Detailed Description

The QIconSelector class provides an icon-based combo box implementation.

QIconSelector operates similarly to a combo box but it has an important difference. It deals with information that is represented as both an icon and as text. The widget itself displays only icons while the pop-up selector displays both icon and text. This makes it suitable for placement in areas where there is limited horizontal space.

Here is a QIconSelector next to a text field. When down, it takes up very little room.

"QIconSelector"

Here is the pop-up selector. Both the icons and text are visible.

"QIconSelector pop-up selector"


Member Function Documentation

QIconSelector::QIconSelector ( QWidget * parent = 0 )

Constructs a QIconSelector with the given parent.

QIconSelector::QIconSelector ( const QIcon & icn, QWidget * parent = 0 )

Constructs a QIconSelector with initial icon icn and the given parent.

QIconSelector::~QIconSelector ()

Destroys a QIconSelector.

void QIconSelector::activated ( int index )   [signal]

This signal is emitted when an item is activated. The item is indicated by index.

void QIconSelector::clear ()

Removes all items.

Note that no icon will be visible.

uint QIconSelector::count () const

Returns the number of items the QIconSelector contains.

int QIconSelector::currentIndex () const

Returns the index of the currently selected item. This will be -1 if no items are selected.

See also setCurrentIndex().

QIcon QIconSelector::icon () const

Returns the icon that is being displayed.

See also setIcon().

void QIconSelector::insertItem ( const QIcon & icn, const QString & text = QString() )

Adds an item to the QIconSelector with icon icn and text text.

void QIconSelector::itemSelected ( int index )   [protected]

Closes the pop-up selector and selects the item at index index.

void QIconSelector::popdown ()   [protected slot]

Closes the pop-up selector.

void QIconSelector::popup ()   [protected slot]

Opens the pop-up selector.

void QIconSelector::removeIndex ( int index )

Removes the item at index index.

void QIconSelector::setCurrentIndex ( int index )   [slot]

Sets the current selected item to the item at index index. Set index to -1 to select no items. Note that no icon will be visible if no items are selected.

See also currentIndex().

void QIconSelector::setIcon ( const QIcon & icn )

Sets the displayed icon to icn. Note that this does not change the selected item so using this function may confuse the user. It is provided so that a suitable icon can be displayed when nothing is selected.

See also icon().

QString QIconSelector::text () const

Returns the text that is associated with the icon that is currently being displayed.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3