KIconButton

KDE 4.2 PyKDE API Reference

- KDE's Python API

# KIconButton Class Reference

`from PyKDE4.kio import *`

Inherits: QPushButton → QAbstractButton → QWidget → QObject

## Detailed Description

## Signals
| iconChanged (QString icon)
## Methods
| __init__ (self, QWidget parent=0)
| __init__ (self, KIconLoader loader, QWidget parent)
| __init__ (self, KIconButton a0)
int | buttonIconSize (self)
QString | icon (self)
| iconChanged (self, QString icon)
int | iconSize (self)
| resetIcon (self)
| setButtonIconSize (self, int size)
| setIcon (self, QString icon)
| setIcon (self, QIcon icon)
| setIconSize (self, int size)
| setIconType (self, KIconLoader.Group group, KIconLoader.Context context, bool user=0)
| setStrictIconSize (self, bool b)
bool | strictIconSize (self)

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Constructs a KIconButton using the global iconloader.

Parameters:

  | parent | The parent widget.

__init__ | ( | self, |
|  | KIconLoader | loader,
|  | QWidget | parent
| ) |  |  |

Constructs a KIconButton using a specific KIconLoader.

Parameters:

  | loader | The icon loader to use.
  | parent | The parent widget.

__init__ | ( | self, |
|  | KIconButton | a0
| ) |  |  |

int buttonIconSize | ( |  | self ) |

Returns the Button's Icon-Size

Since:
  4.1

QString icon | ( |  | self ) |

Returns the name of the selected icon.

iconChanged | ( | self, |
|  | QString | icon
| ) |  |  |

Emitted when the icon has changed.

Signal syntax:
  `QObject.connect(source, SIGNAL("iconChanged(const QString&)"), target_slot)`

int iconSize | ( |  | self ) |

Returns the iconsize set via setIconSize() or 0, if the default iconsize will be used.

resetIcon | ( |  | self ) |

Resets the icon (reverts to an empty button).

setButtonIconSize | ( | self, |
|  | int | size
| ) |  |  |

Sets the size of the icon to be shown on the button

See also:
  KIconLoader.StdSizes

See also:
  buttonIconSize

Since:
  4.1

setIcon | ( | self, |
|  | QString | icon
| ) |  |  |

Sets the button's initial icon.

setIcon | ( | self, |
|  | QIcon | icon
| ) |  |  |

setIconSize | ( | self, |
|  | int | size
| ) |  |  |

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

See also:
  KIconLoader.StdSizes

See also:
  iconSize

setIconType | ( | self, |
|  | KIconLoader.Group | group,
|  | KIconLoader.Context | context,
|  | bool | user=0
| ) |  |  |

Sets the icon group and context. Use KIconLoader.NoGroup if you want to allow icons for any group in the given context.

setStrictIconSize | ( | self, |
|  | 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.

bool strictIconSize | ( |  | self ) |

Returns true if a strict icon size policy is set.