KIconThemes

kiconbutton.h
1 /* vi: ts=8 sts=4 sw=4
2  *
3  * This file is part of the KDE project, module kfile.
4  * Copyright (C) 2000 Geert Jansen <[email protected]>
5  * (C) 2000 Kurt Granroth <[email protected]>
6  * (C) 1997 Christoph Neerfeld <[email protected]>
7  * (C) 2002 Carsten Pfeiffer <[email protected]>
8  *
9  * This is free software; it comes under the GNU Library General
10  * Public License, version 2. See the file "COPYING.LIB" for the
11  * exact licensing terms.
12  */
13 
14 #ifndef KICONBUTTON_H
15 #define KICONBUTTON_H
16 
17 #include "kiconthemes_export.h"
18 
19 #include <QPushButton>
20 
21 #include <kiconloader.h>
22 
33 class KICONTHEMES_EXPORT KIconButton: public QPushButton
34 {
35  Q_OBJECT
36  Q_PROPERTY(QString icon READ icon WRITE setIcon RESET resetIcon NOTIFY iconChanged USER true)
37  Q_PROPERTY(int iconSize READ iconSize WRITE setIconSize)
38  Q_PROPERTY(bool strictIconSize READ strictIconSize WRITE setStrictIconSize)
39 
40 public:
46  explicit KIconButton(QWidget *parent = nullptr);
47 
54  KIconButton(KIconLoader *loader, QWidget *parent);
55 
59  ~KIconButton();
60 
66  void setStrictIconSize(bool b);
70  bool strictIconSize() const;
71 
76  void setIconType(KIconLoader::Group group, KIconLoader::Context context, bool user = false);
77 
81  void setIcon(const QString &icon);
82 
83  void setIcon(const QIcon &icon);
84 
88  void resetIcon();
89 
93  const QString &icon() const;
94 
100  void setIconSize(int size);
105  int iconSize() const;
106 
113  void setButtonIconSize(int size);
118  int buttonIconSize() const;
119 
120 Q_SIGNALS:
124  void iconChanged(const QString &icon);
125 
126 private:
127  class KIconButtonPrivate;
128  KIconButtonPrivate *const d;
129 
131 };
132 
133 #endif // KICONBUTTON_H
A pushbutton for choosing an icon.
Definition: kiconbutton.h:33
void setIcon(const QIcon &icon)
void setIconSize(const QSize &size)
Q_PROPERTY(...)
Q_DISABLE_COPY(Class)
Context
Defines the context of the icon.
Definition: kiconloader.h:86
Group
The group of the icon.
Definition: kiconloader.h:129
Iconloader for KDE.
Definition: kiconloader.h:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed May 27 2020 22:49:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.