# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KIconButton Class Reference

A pushbutton for choosing an icon. A push button that allows selection of an icon. More...

`#include <kicondialog.h>`

Inheritance diagram for KIconButton:

[legend]
Collaboration diagram for KIconButton:

[legend]
List of all members.

## Signals

void | iconChanged (QString icon)
| Emitted when the icon has changed.

## Public Member Functions

| KIconButton (QWidget *parent=0L, const char *name=0L)
| Constructs a KIconButton using the global iconloader.
| KIconButton (KIconLoader *loader, QWidget *parent, const char *name=0L)
| Constructs a KIconButton using a specific KIconLoader.
| ~KIconButton ()
| Destructs the button.
void | setStrictIconSize (bool b)
| Sets a strict icon size policy for allowed icons.
bool | strictIconSize () const
| Returns true if a strict icon size policy is set.
void | setIconType (KIcon::Group group, KIcon::Context context, bool user=false)
| Sets the icon group and context.
void | setIcon (const QString &icon)
| Sets the button's initial icon.
void | resetIcon ()
| Resets the icon (reverts to an empty button).
QString | icon () const
| Returns the name of the selected icon.
void | setIconSize (int size)
| Sets the size of the icon to be shown / selected.
int | iconSize () const
| Returns the iconsize set via setIconSize() or 0, if the default iconsize will be used.

## Detailed Description

A pushbutton for choosing an icon. A push button that allows selection of an icon.

Pressing on the button will open a KIconDialog for the user to select an icon. The current icon will be displayed on the button.

See also:
  KIconDialog

Definition at line 227 of file kicondialog.h.

## Constructor & Destructor Documentation

KIconButton::KIconButton | ( | QWidget * | parent = 0L,
|  | const char * | name = 0L
| ) |

| Constructs a KIconButton using the global iconloader. Definition at line 477 of file kicondialog.cpp. References KIcon::Application, QPushButton::clicked(), KGlobal::iconLoader(), and KStdAccel::name().

KIconButton::KIconButton | ( | KIconLoader * | loader,
|  | QWidget * | parent,
|  | const char * | name = 0L
| ) |

| Constructs a KIconButton using a specific KIconLoader. Definition at line 491 of file kicondialog.cpp. References KIcon::Application, QPushButton::clicked(), and KStdAccel::name().

KIconButton::~KIconButton | ( |  | ) |

| Destructs the button. Definition at line 505 of file kicondialog.cpp.

## Member Function Documentation

void KIconButton::setStrictIconSize | ( | bool | b | ) |

| Sets a strict icon size policy for allowed icons. When true, only icons of the specified group's size in setIconType are allowed, and only icons of that size will be shown in the icon dialog. Definition at line 511 of file kicondialog.cpp. Referenced by KFilePropsPlugin::KFilePropsPlugin(), and KURLBarItemDialog::KURLBarItemDialog().

bool KIconButton::strictIconSize | ( |  | ) | const

| Returns true if a strict icon size policy is set. Definition at line 516 of file kicondialog.cpp.

void KIconButton::setIconType | ( | KIcon::Group | group,
|  | KIcon::Context | context,
|  | bool | user = false
| ) |

| Sets the icon group and context. Use KIcon::NoGroup if you want to allow icons for any group in the given context. Definition at line 531 of file kicondialog.cpp. Referenced by KFilePropsPlugin::KFilePropsPlugin().

void KIconButton::setIcon | ( | const QString & | icon | ) |

| Sets the button's initial icon. Definition at line 538 of file kicondialog.cpp. References KIconLoader::iconPath(), KIconLoader::loadIcon(), KIconDialog::setCustomLocation(), and QPushButton::setPixmap(). Referenced by KFilePropsPlugin::KFilePropsPlugin(), and KURLBarItemDialog::KURLBarItemDialog().

void KIconButton::resetIcon | ( |  | ) |

| Resets the icon (reverts to an empty button). Definition at line 548 of file kicondialog.cpp. References QPushButton::setPixmap().

QString KIconButton::icon | ( |  | ) | const`[inline]`

| Returns the name of the selected icon. Definition at line 276 of file kicondialog.h. Referenced by KDevicePropsPlugin::applyChanges(), and KURLBarItemDialog::icon().

void KIconButton::setIconSize | ( | int | size | ) |

Sets the size of the icon to be shown / selected.

See also:
  KIcon::StdSizes

  iconSize

Definition at line 521 of file kicondialog.cpp.

Referenced by KURLBarItemDialog::KURLBarItemDialog().

int KIconButton::iconSize | ( |  | ) | const

| Returns the iconsize set via setIconSize() or 0, if the default iconsize will be used. Definition at line 526 of file kicondialog.cpp.

void KIconButton::iconChanged | ( | QString | icon | ) | `[signal]`

| Emitted when the icon has changed.

The documentation for this class was generated from the following files:

- kicondialog.h
- kicondialog.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:18:37 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001