KIconThemes 5.109.0
|
Dialog for interactive selection of icons. More...
#include <KIconDialog>
Signals | |
void | newIconName (const QString &iconName) |
Public Member Functions | |
KIconDialog (QWidget *parent=nullptr) | |
Constructs an icon selection dialog using the global icon loader. | |
~KIconDialog () override | |
Destructs the dialog. | |
int | iconSize () const |
Returns the icon size set via setIconSize() or 0, if the default icon size will be used. | |
QString | openDialog () |
exec()utes this modal dialog and returns the name of the selected icon, or QString() if the dialog was aborted. | |
void | setCustomLocation (const QString &location) |
Sets the location of the custom icon directory. | |
void | setIconSize (int size) |
Sets the size of the icons to be shown / selected. | |
void | setSelectedIcon (const QString &iconName) |
Sets the icon that is initially selected in the dialog. | |
void | setStrictIconSize (bool policy) |
Sets a strict icon size policy for allowed icons. | |
void | setup (KIconLoader::Group group, KIconLoader::Context context=KIconLoader::Application, bool strictIconSize=false, int iconSize=0, bool user=false, bool lockUser=false, bool lockCustomDir=false) |
Allows you to set the same parameters as in the class method getIcon(), as well as two additional parameters to lock the choice between system and user directories and to lock the custom icon directory itself. | |
void | showDialog () |
show()s this dialog and emits a newIconName(const QString&) signal when successful. | |
bool | strictIconSize () const |
Returns true if a strict icon size policy is set. | |
Static Public Member Functions | |
static QString | getIcon (KIconLoader::Group group=KIconLoader::Desktop, KIconLoader::Context context=KIconLoader::Application, bool strictIconSize=false, int iconSize=0, bool user=false, QWidget *parent=nullptr, const QString &title=QString()) |
Pops up the dialog an lets the user select an icon. | |
Protected Slots | |
void | slotOk () |
Dialog for interactive selection of icons.
Use the function getIcon() to let the user select an icon.
An icon selection dialog.
|
explicit |
Constructs an icon selection dialog using the global icon loader.
parent | The parent widget. |
|
override |
Destructs the dialog.
|
static |
Pops up the dialog an lets the user select an icon.
group | The icon group this icon is intended for. Providing the group shows the icons in the dialog with the same appearance as when used outside the dialog. |
context | The initial icon context. Initially, the icons having this context are shown in the dialog. The user can change this. |
strictIconSize | When true, only icons of the specified group's size are shown, otherwise icon not available in the desired group's size will also be selectable. |
iconSize | the size of the icons – the default of the icon group if set to 0 |
user | Begin with the "user icons" instead of "system icons". |
parent | The parent widget of the dialog. |
title | The title to use for the dialog. |
int KIconDialog::iconSize | ( | ) | const |
Returns the icon size set via setIconSize() or 0, if the default icon size will be used.
QString KIconDialog::openDialog | ( | ) |
exec()utes this modal dialog and returns the name of the selected icon, or QString() if the dialog was aborted.
void KIconDialog::setCustomLocation | ( | const QString & | location | ) |
Sets the location of the custom icon directory.
Only local directory paths are allowed.
void KIconDialog::setIconSize | ( | int | size | ) |
Sets the size of the icons to be shown / selected.
void KIconDialog::setSelectedIcon | ( | const QString & | iconName | ) |
Sets the icon that is initially selected in the dialog.
iconName | The name of the icon to select |
void KIconDialog::setStrictIconSize | ( | bool | policy | ) |
Sets a strict icon size policy for allowed icons.
policy | When true, only icons of the specified group's size in getIcon() are shown. When false, icons not available at the desired group's size will also be selectable. |
void KIconDialog::setup | ( | KIconLoader::Group | group, |
KIconLoader::Context | context = KIconLoader::Application , |
||
bool | strictIconSize = false , |
||
int | iconSize = 0 , |
||
bool | user = false , |
||
bool | lockUser = false , |
||
bool | lockCustomDir = false |
||
) |
Allows you to set the same parameters as in the class method getIcon(), as well as two additional parameters to lock the choice between system and user directories and to lock the custom icon directory itself.
void KIconDialog::showDialog | ( | ) |
show()s this dialog and emits a newIconName(const QString&) signal when successful.
QString() will be emitted if the dialog was aborted.
bool KIconDialog::strictIconSize | ( | ) | const |
Returns true if a strict icon size policy is set.